forked from python/mypy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep track of fstring conversions and format-specs (python#6965)
Modify fastparse.py to keep track of format specifiers and conversions for f-strings. Currently, braces values within f-strings are just converted to calls to format, ignoring format specifiers and conversions ('{}'.format(...)). With this the information regarding format specifiers and conversions are passed along to format. To accomodate format specifiers with expressions evaluated at runtime, we pass the format specifier as an argument also (ex: '{!r{}}.format(..., "<30")'). Note that format specifiers can contain expressions that are evaluated at runtime. Keeping track of this information is needed in order to provide mypyc with enough information to support fstrings with format specifiers and conversions.
- Loading branch information
Showing
2 changed files
with
130 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters