Message410927
The initial aim of the dis.Positions was to provide an interface like AST nodes. So you could do
for instr in dis.Bytecode(source):
print("located in: ", instr.positions.lineno)
instead of
for instr in dis.Bytecode(source):
if instr.positions:
lineno = instr.positions[0]
else:
lineno = None
print("located in: ", lineno)
I think this is a bug that we are not currently using it, I'd say we should use it properly and go with option 2. |
|
| Date |
User |
Action |
Args |
| 2022-01-19 08:52:55 | BTaskaya | set | recipients:
+ BTaskaya, pablogsal, sobolevn |
| 2022-01-19 08:52:55 | BTaskaya | set | messageid: <[email protected]> |
| 2022-01-19 08:52:55 | BTaskaya | link | issue46422 messages |
| 2022-01-19 08:52:55 | BTaskaya | create | |
|