A RetroSearch Logo

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

Search Query:

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

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

[Python-Dev] PEP 285: Adding a bool type [Python-Dev] PEP 285: Adding a bool typeAndrew Koenig ark@research.att.com
04 Apr 2002 10:16:36 -0500
>> On a side note, writing 'i or False and True' performs much better
>> than bool(i) in the test implementation, and flow control statements
>> involving ints are perform much better than flow control using bool.
>> Will there be a performance degredation in the final version, or can
>> this be avoided?

Guido> That surprises me.  Can you show your benchmark?

Doesn't 'i or False and True' always evaluate to 'i', rather than to
'bool(i)' because 'and' binds more tighly than 'or'?

What's the corresponding performance measure for 'i and True or False'?

-- 
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark




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