On Wed, Aug 8, 2012 at 12:14 PM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > NoneType raises an error if you try to create a second instance. bool > just returns one of the two singletons (doubletons?) again. > > py> type(None)() > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > TypeError: cannot create 'NoneType' instances > py> type(False)() is False > True
This is necessitated by the use of bool(x) as a means of boolifying ("casting to bool", if you like) x. I wouldn't want that to change, and since type(False) is bool, what you see is bound to occur. ChrisA -- http://mail.python.org/mailman/listinfo/python-list