Closed as not planned
Description
Bug report
Bug description:
Description
If PDB is executed within a function trace and function argument arg
is defined, executing [arg for _ in [0]]
within PDB throws NameError: name 'arg' is not defined
.
To reproduce
import pdb
def fun(t):
print([t for _ in [0]])
pdb.set_trace()
fun(42)
Execute the code until PDB breaks upon pdb.set_trace()
. In PDB, executing t
will return 42
, but executing [t for _ in [0]]
throws NameError: name 't' is not defined
:
Log
[42]
--Return--
> /home/main.py(5)fun()->None
-> pdb.set_trace()
(Pdb) t
42
(Pdb) [t for _ in [0]]
*** NameError: name 't' is not defined
Tested locally on 3.11.9 and on https://www.onlinegdb.com/online_python_debugger.
CPython versions tested on:
3.11
Operating systems tested on:
Linux