[New-bugs-announce] [issue41907] Regression in IntFlag behaviour in f-string

Roger Taylor report at bugs.python.org
Thu Oct 1 22:38:10 EDT 2020


New submission from Roger Taylor <roger.taylor.email at gmail.com>:

An IntFlag member before 3.8.6 was converted to an integer in an f-string. After 3.8.6, the textual IntFlag class and member name are placed in the interpolated f-string instead of the integer.

3.8.3: f"... {X.F} ..." where X.F = 1 << 4 will give "... 16 ..."
3.8.5: Same
3.8.6: f"... {X.F} ..." where X.F = 1 << 4 will give "... X.F ..."

I have reproduced this on Linux using the version compiled and installed by pyenv, and on Windows using the 32-bit versions from the downloadable standalone installer.

Now I have to locate and go through all my SQL statements and verify that they explicitly convert IntFlag values to integer to avoid the errors introduced by this regression.

----------
components: Interpreter Core
messages: 377793
nosy: rt121212121
priority: normal
severity: normal
status: open
title: Regression in IntFlag behaviour in f-string
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41907>
_______________________________________


More information about the New-bugs-announce mailing list