You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[3.13.0b4] f-string with precision specifier has format_spec of Constant, not JoinedStr #122300
changed the title [-][3.13.0b4] f-string with precision specifier has `format_spec` of `Const`, not `JoinedStr`[/-][+][3.13.0b4] f-string with precision specifier has `format_spec` of `Constant`, not `JoinedStr`[/+]on Jul 26, 2024
Thanks for the bisect. That PR updated the docs for ast.JoinedStr to show this as the new expected result, so maybe we just need a docs update for ast.FormattedValue?
Thanks for the bisect. That PR updated the docs for ast.JoinedStr to show this as the new expected result, so maybe we just need a docs update for ast.FormattedValue?
Note that the docs are not prescriptive over what the shape of the AST will be, it's just an example. The actual shape of the AST can still change due to bug fixes and grammar extensions so I would not recommend looking at those docs as a prescription with any backwards compatibility guarantees.
Being said that I can try to investigate how difficult it's to preserve this because I understand how annoying this can be downstream if you don't have anything you can match against and was like that for several versions.
Activity
[-][3.13.0b4] f-string with precision specifier has `format_spec` of `Const`, not `JoinedStr`[/-][+][3.13.0b4] f-string with precision specifier has `format_spec` of `Constant`, not `JoinedStr`[/+]Eclips4 commentedon Jul 26, 2024
Bisected to c46d64e
cc @pablogsal
jacobtylerwalls commentedon Jul 26, 2024
Thanks for the bisect. That PR updated the docs for
ast.JoinedStrto show this as the new expected result, so maybe we just need a docs update forast.FormattedValue?pablogsal commentedon Jul 26, 2024
Note that the docs are not prescriptive over what the shape of the AST will be, it's just an example. The actual shape of the AST can still change due to bug fixes and grammar extensions so I would not recommend looking at those docs as a prescription with any backwards compatibility guarantees.
Being said that I can try to investigate how difficult it's to preserve this because I understand how annoying this can be downstream if you don't have anything you can match against and was like that for several versions.
pythongh-122300: Preserve AST nodes for format specifiers with single…
pablogsal commentedon Jul 26, 2024
I think #122308 will do the trick
pythongh-122300: Preserve AST nodes for format specifiers with single…
gh-122300: Preserve AST nodes for format specifiers with single eleme…
penguinpee commentedon Jul 26, 2024
Yep. #122308 fixes the test regressions in
ropeandastorthat I reported in #122307. Thanks!pablogsal commentedon Jul 26, 2024
Will backport this soon
[3.12] pythongh-122300: Preserve AST nodes for format specifiers with…
[3.12] pythongh-122300: Preserve AST nodes for format specifiers with…
[3.13] pythongh-122300: Preserve AST nodes for format specifiers with…
[3.12] gh-122300: Preserve AST nodes for format specifiers with singl…
[3.13] gh-122300: Preserve AST nodes for format specifiers with singl…
pablogsal commentedon Jul 27, 2024
All done!