[Python-ideas] True and False are singletons
mertz at gnosis.cx
Mon Mar 18 17:47:17 EDT 2019
It was a VERY long time ago when True and False were not singletons. I
don't think we should still try to write code based on rules that stopped
applying more than a decade ago.
On Mon, Mar 18, 2019, 5:42 PM Greg Ewing <greg.ewing at canterbury.ac.nz>
> Oleg Broytman wrote:
> > Three-way (tri state) checkbox. You have to distinguish False and
> > None if the possible valuse are None, False and True.
> In that case the conventional way to write it would be
> if settings[MY_KEY] == True:
> It's not a major issue, but I get nervous when I see code
> that assumes True and False are unique, because things
> weren't always that way.
> Python-ideas mailing list
> Python-ideas at python.org
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas