B
Billy Mays
<class 'NoneType'>
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
TypeError: cannot create 'NoneType' instances
Why is NoneType unable to produce a None instance? I realise that None
is a singleton, but so are True and False, and bool is able to handle
returning them:
--> bool(0) is bool(0)
True
This feels like a violation of 'Special cases aren't special enough to
break the rules.'
~Ethan~
Probably for the same reason Ellipsis and NotImplemented also can't be
instantiated. What that reason is I don't know. Related:
http://bugs.python.org/issue6477#msg90641