On 07/28/2011 11:39 AM, Ethan Furman wrote:
<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

--
Bill
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to