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
Source locations of comprehension bytecode are incorrect #98461
def f():
[(x,
2*x)
for x
in [1,2,3] if (x > 0
and x < 100
and x != 50)]
f = f.__code__.co_consts[1]
import dis
from pprint import pprint as pp
def pos(p):
return (p.lineno, p.end_lineno, p.col_offset, p.end_col_offset)
pp([(pos(x.positions), x.opname, x.argval) for x in dis.get_instructions(f)])
changed the title [-]Source location of comprehension bytecode are incorrect[/-][+]Source locations of comprehension bytecode are incorrect[/+]on Oct 20, 2022
Activity
iritkatriel commentedon Oct 19, 2022
Correct output should be:
pythongh-98461: Fix source location in comprehensions bytecode
iritkatriel commentedon Oct 19, 2022
FYI @nedbat .
[-]Source location of comprehension bytecode are incorrect[/-][+]Source locations of comprehension bytecode are incorrect[/+]gh-98461: Fix source location in comprehensions bytecode (GH-98464)
Merge branch 'main' into typewatch
pythongh-98461: Fix location of RETURN_VALUE in async generator bytec…
gh-98461: Fix location of RETURN_VALUE in async generator bytecode. c…