On Mon, Dec 26, 2011 at 12:48 AM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > I can't think of any other un-subclassable classes other than NoneType. > Which ones are you thinking of?
I don't remember, but it was mentioned in a thread a little while ago. Experimentation shows that 'bool' is one of them, though. This may shed some light: >>> class Foo(type(iter)): pass Traceback (most recent call last): File "<pyshell#103>", line 1, in <module> class Foo(type(iter)): TypeError: type 'builtin_function_or_method' is not an acceptable base type I think there are certain types that are actually not implemented as classes, and hence cannot be subclassed. This is almost certainly an implementation detail though; my testing was done in Py3.2 (on Windows fwiw). ChrisA -- http://mail.python.org/mailman/listinfo/python-list