Re: True is True / False is False?

2020-07-23 Thread Peter Slížik
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

Re: True is True / False is False?

2020-07-22 Thread Chris Angelico
ans returned from comparisons-operators, > >>> guaranteeing that they always return The One True and The One > >>> False. > >> > >> That said, though, a comparison isn't required to return a bool. > >> If it *does* return a bool, it has to be one of those exact tw

Re: True is True / False is False?

2020-07-22 Thread Tim Chase
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 T

Re: True is True / False is False?

2020-07-22 Thread Oscar Benjamin
t; > didn't encounter anything about booleans returned from > > comparisons-operators, guaranteeing that they always return The One > > True and The One False. ... > > That said, though, a comparison isn't required to return a bool. If it > *does* return a bool, it has to be on

Re: True is True / False is False?

2020-07-21 Thread Chris Angelico
they always return The One > True and The One False. class bool(int) | bool(x) -> bool | | Returns True when the argument x is true, False otherwise. | The builtins True and False are the only two instances of the class bool. | The class bool is a subclass of the class int, and can

True is True / False is False?

2020-07-21 Thread Tim Chase
(and often *should*) be compared using `is`. However I spent some time 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. x = 3 == 3 # some boolean expression