A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-April/022379.html below:

[Python-Dev] PEP 285: Adding a bool type

[Python-Dev] PEP 285: Adding a bool typeGuido van Rossum guido@python.org
Fri, 05 Apr 2002 11:21:44 -0500
> > No - I was benchmarking with the patch posted on Sourceforge (before
> > PEP285 was checked into CVS), patched into a CVS snapshot taken at
> > the same time.
> > 
> >   Casting  to bool using (x and True) or (x or False)  :  1.61
> >   Casting to bool using (bool)  :  2.68
> >   Flow control on explicit True  :  1.42
> >   Flow control on explicit 1  :  0.99
> >   Flow control on variable bound to True  :  1.02
> >   Flow control on variable bound to 1  :  0.99
> 
> time to make keywords out of True, False (and None)?

None should be a keyword, yes.  Patch anyone?

Making True and False keywords would cause unnecessary breakage of
legacy code that defines its own bools and names them True or False.
We might be able to do this after a few more releases, after we've
added warnings for assignment to them.

I kind of doubt that calls to bool() or code saying "if True" (or
"return True" or "x = True") is in the critical path of anything.

--Guido van Rossum (home page: http://www.python.org/~guido/)




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4