Dear Tim,
in Python 2, None is a keyword and True and False are just identifiers. In
Python 3, all of them are keywords.
There is an interesting article by Guido explaining the reason for their
different implementations.
http://python-history.blogspot.com/2013/11/story-of-none-true-false.html
J
On Thu, Jul 23, 2020 at 5:51 AM Tim Chase wrote:
>
> On 2020-07-22 11:54, Oscar Benjamin wrote:
> >> On Wed, Jul 22, 2020 at 11:04 AM Tim Chase wrote:
> >>> reading through the language specs and didn't encounter
> >>> anything about booleans returned from comparisons-operators,
> >>> guaranteeing
On 2020-07-22 11:54, Oscar Benjamin wrote:
>> On Wed, Jul 22, 2020 at 11:04 AM Tim Chase wrote:
>>> reading through the language specs and didn't encounter
>>> anything about booleans returned from comparisons-operators,
>>> guaranteeing that they always return The One True and The One
>>> False.
On Wed, 22 Jul 2020 at 02:12, Chris Angelico wrote:
>
> On Wed, Jul 22, 2020 at 11:04 AM Tim Chase
> wrote:
> >
> > I know for ints, cpython caches something like -127 to 255 where `is`
> > works by happenstance based on the implementation but not the spec
> > (so I don't use `is` for comparison
On Wed, Jul 22, 2020 at 11:04 AM Tim Chase
wrote:
>
> I know for ints, cpython caches something like -127 to 255 where `is`
> works by happenstance based on the implementation but not the spec
> (so I don't use `is` for comparison there because it's not
> guaranteed by the language spec). On the o
I know for ints, cpython caches something like -127 to 255 where `is`
works by happenstance based on the implementation but not the spec
(so I don't use `is` for comparison there because it's not
guaranteed by the language spec). On the other hand, I know that None
is a single object that can (and