-
-
Couldn't load subscription status.
- Fork 33.3k
Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtopic-parsertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
import ast
code = """
f"My name is {name}"
rf"My name is {name}"
"""
print(ast.dump(ast.parse(code), indent=4))
ast_obj = ast.parse(code)
print(ast.unparse(ast_obj))output
Module(
body=[
Expr(
value=JoinedStr(
values=[
Constant(value='My name is '),
FormattedValue(
value=Name(id='name', ctx=Load()),
conversion=-1)])),
Expr(
value=JoinedStr(
values=[
Constant(value='My name is '),
FormattedValue(
value=Name(id='name', ctx=Load()),
conversion=-1)]))],
type_ignores=[])
f'My name is {name}'
f'My name is {name}'
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtopic-parsertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error