Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
3.11:
>>>importast>>>print(ast.dump(ast.parse("""f'"{var:}"'"""),indent=2))Module(body=[Expr(value=JoinedStr(values=[Constant(value='"'),FormattedValue(value=Name(id='var',ctx=Load()),conversion=-1,format_spec=JoinedStr(values=[])),Constant(value='"')]))],type_ignores=[])
3.12:
>>>importast>>>print(ast.dump(ast.parse("""f'"{var:}"'"""),indent=2))Module(body=[Expr(value=JoinedStr(values=[Constant(value='"'),FormattedValue(value=Name(id='var',ctx=Load()),conversion=-1,format_spec=JoinedStr(values=[Constant(value='')])),Constant(value='"')]))],type_ignores=[])
This affects several linters:
- Fix parse test case on Python 3.12 mypy#15577
- B907 crashes when bugbear is run on Python 3.12 PyCQA/flake8-bugbear#393
Is this a bug? Or is it a feature?