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
FormattedValue (fstring) in noworkflow are incorrectly capturing entire string literals instead of parsing and capturing only the literal parts
f"Hello, my name is {name} and I am {age} years old."
will give values
name
type
f"Hello, my name is {name} and I am {age} years old."
fstring
f"Hello, my name is {name} and I am {age} years old."
literal
{name}
fvalue
f"Hello, my name is {name} and I am {age} years old."
literal
{age}
fvalue
f"Hello, my name is {name} and I am {age} years old."
literal
but the correct literal should captured separately the formatted value (fvalues), as demonstrated in the example below using ast.dump:
Module(
body=[
Expr(
value=JoinedStr(
values=[
Constant(value='Hello, my name is '),
FormattedValue(
value=Name(id='name', ctx=Load()),
conversion=-1),
Constant(value=' and I am '),
FormattedValue(
value=Name(id='age', ctx=Load()),
conversion=-1),
Constant(value=' years old.')]))],
type_ignores=[])
In noworkflow, the equivalent representation should be
name
type
f"Hello, my name is {name} and I am {age} years old."
fstring
"Hello, my name is "
literal
{name}
fvalue
" and I am "
literal
{age}
fvalue
" years old."
literal
The text was updated successfully, but these errors were encountered:
FormattedValue (
fstring
) in noworkflow are incorrectly capturing entire string literals instead of parsing and capturing only the literal partsf"Hello, my name is {name} and I am {age} years old."
will give values
but the correct literal should captured separately the formatted value (
fvalues
), as demonstrated in the example below using ast.dump:In noworkflow, the equivalent representation should be
The text was updated successfully, but these errors were encountered: