NoneType and new instances
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Sun Jul 31 00:28:57 EDT 2011
Terry Reedy wrote:
> On 7/30/2011 12:39 PM, bruno.desthuilliers at gmail.com wrote:
>> On 28 juil, 17:39, Ethan Furman<et... at stoneleaf.us> wrote:
>>>
>>> --> bool(0) is bool(0)
>>> True
>
>> This test is not reliable
>
> It is in the sense that it will always work -- because False/True are
> doubletone constants and so documented.
Surely that should be doubleton :)
2.2: True and False released as names for 1 and 0; bool was a built-in
function, but not a type.
2.3: bool promoted to a type; True and False actual bools. The documentation
claims that there's only one instance of each.
I'm sure that I remember a short period during which Python had bools, but
didn't guarantee that there would only be one instance of True and one of
False, but I'm damned if I can find any evidence of this. Am I
confabulating?
--
Steven
More information about the Python-list
mailing list