Skip to content
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

Add f-string var= support #113

Open
wants to merge 6 commits into
base: astlib
Choose a base branch
from
Open

Conversation

martinwicke
Copy link
Contributor

"Self-documenting variables" was added in Python3.8 (https://docs.python.org/3/whatsnew/3.8.html#f-strings-support-for-self-documenting-expressions-and-debugging) but currently confuses the annotator (it expects a '!' for a conversion, but sees a '=' instead).

Eat a = after a variable in an f-string. This is already encoded in the structure of the JoinedStr so we shouldn't have to remember it.
testdata/ast/fstring.in Outdated Show resolved Hide resolved
testdata/ast/fstring.in Outdated Show resolved Hide resolved
pasta/base/annotate.py Outdated Show resolved Hide resolved
pasta/base/annotate.py Outdated Show resolved Hide resolved
pasta/base/annotate.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants