singleton ... again

Chris Angelico rosuav at
Thu Feb 13 05:33:11 CET 2014

On Thu, Feb 13, 2014 at 3:24 PM, Steven D'Aprano <steve at> wrote:
> Of course it can happen by accident. It's happened to me, where I've
> accidentally called NoneType() (which raises, rather than returning a new
> instance).

It does in 2.7, yes, but not in 3.4:

>>> type(None)() is None

Definitely prefer returning the singleton to raising.


More information about the Python-list mailing list