[Python-ideas] True and False are singletons

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Mar 18 18:32:56 EDT 2019


Tim Delaney wrote:
> I would argue the opposite - the use of "is" shows a clear knowledge 
> that True and False are each a singleton and the author explicitly 
> intended to use them that way.

I don't think you can infer that. It could equally well be someone who's
*not* familiar with Python truth rules and really just meant "if x".
Or someone who's unfamiliar with booleans in general and thinks that
every "if" statement has to have a comparison in it.

-- 
Greg


More information about the Python-ideas mailing list