type(None)()

Stefan Behnel stefan_ml at behnel.de
Thu Aug 16 11:44:49 EDT 2012


Ramchandra Apte, 16.08.2012 17:39:
> On 16 August 2012 21:01, Stefan Behnel wrote:
>> Steven D'Aprano, 16.08.2012 15:58:
>>>>> NoneType raises an error if you try to create a second instance.
>>> In my opinion, this is a PITA for None and better behaviour would be to
>>> return the pre-existing NoneType instance, but I didn't design the
>>> language.
>>
>> The time machine strikes again.
>>
>> Python 3.3.0b1 (default:f7b59e890e30, Aug 11 2012, 05:30:10)
>> [GCC 4.6.3] on linux
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> type(None)()
>>>>> print(type(None)())
>> None
>
> Are they the same object

Obviously. None is a singleton (as was already mentioned a couple of times
in this thread).

Stefan





More information about the Python-list mailing list