Skip to content

Conversation

BobTheBuidler
Copy link
Contributor

if a variable is Final but the value is not yet known at compile-time, and that variable is used as an input to an f-string, the f-string will incorrectly contain "None"

Fixes mypyc#1140

if a variable is Final but the value is not yet known at compile-time, and that variable is used as an input to an f-string, the f-string will incorrectly contain "None"
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! It would be good to have a run test for this as well.

@BobTheBuidler
Copy link
Contributor Author

Done

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks like a similar thing might happen in strconv.py (which is minor)

@hauntsaninja hauntsaninja merged commit dce8e1c into python:master Sep 16, 2025
13 checks passed
KevinRK29 pushed a commit that referenced this pull request Sep 16, 2025
if a variable is Final but the value is not yet known at compile-time, and that variable is used as an input to an f-string, the f-string will incorrectly contain "None" Fixes [mypyc#1140](mypyc/mypyc#1140) (cherry picked from commit dce8e1c)
ilevkivskyi pushed a commit that referenced this pull request Sep 25, 2025
to be honest I have no idea what this code does, but I know we need to fix it per advice from @hauntsaninja in #19846
@BobTheBuidler BobTheBuidler deleted the patch-7 branch September 26, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants