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/2018-March/152531.html below:

[Python-Dev] Subtle difference between f-strings and str.format()

[Python-Dev] Subtle difference between f-strings and str.format() [Python-Dev] Subtle difference between f-strings and str.format()Steven D'Aprano steve at pearwood.info
Thu Mar 29 08:28:26 EDT 2018
On Wed, Mar 28, 2018 at 06:27:19PM +0300, Serhiy Storchaka wrote:

> The optimizer already changes 
> semantic. Non-optimized "if a and True:" would call bool(a) twice, but 
> optimized code calls it only once.

I don't understand this. Why would bool(a) be called twice, and when did 
this change? Surely calling it twice would be a bug.

I just tried the oldest Python 3 I have on this computer, 3.2, and bool 
is only called once.



-- 
Steve
More information about the Python-Dev mailing list

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