[Python-ideas] change NoneType, NotImplementedType, & ellipses to return the appropriate singleton

Steven D'Aprano steve at pearwood.info
Fri Jul 29 19:15:25 CEST 2011


Ethan Furman wrote:

> <class 'NoneType'>
> Traceback (most recent call last):
>   File "<stdin>", line 3, in <module>
> TypeError: cannot create 'NoneType' instances
> 
> I hit this issue when I had a dictionary of types to instantiate, one of 
> which was NoneType.
> 
> Is there any reason why we shouldn't change these three to produce the 
> singleton instance instead of raising an error?

+0.5


-- 
Steven



More information about the Python-ideas mailing list