Skip to content

stubgen does not support debug f-strings using python 3.9+ #11296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rvaquerizor opened this issue Oct 8, 2021 · 1 comment
Closed

stubgen does not support debug f-strings using python 3.9+ #11296

rvaquerizor opened this issue Oct 8, 2021 · 1 comment
Labels
bug mypy got something wrong

Comments

@rvaquerizor
Copy link

Bug Report

I get an error like the following whenever a debug f-string is used in my code and I try to generate a stub to by used with mypy:

Critical error during semantic analysis: myfile.py:76: error: f-string: self documenting expressions are only supported in Python 3.8 and greater

To Reproduce

  1. Put a debug string in your code, like the following:
option = 3
print(f'Debug print: {option=}')
  1. execute stubgen on it, and it will complain with the above error message

Expected Behavior

Debug f-strings supported by stubgen, as long as py3.8+ is used.

Actual Behavior

stubgen fails to generate the pyi file when debug f-strings are found in the py module.

Your Environment

  • Mypy version used: 0.812
  • Mypy command-line flags: None
  • Mypy configuration options from mypy.ini (and other config files): None
  • Python version used: 3.9 and 3.10
  • Operating system and version: Ubuntu, 5.11.0-37-generic Refactor code into packages #41-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
@rvaquerizor rvaquerizor added the bug mypy got something wrong label Oct 8, 2021
@JelleZijlstra
Copy link
Member

Duplicate of #10905

@JelleZijlstra JelleZijlstra marked this as a duplicate of #10905 Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

2 participants