[issue35871] Pdb NameError in generator param and list comprehension

2019-01-31 Thread Jayanth Raman
Jayanth Raman added the comment: Thanks for the "interact" tip. FWIW, I see this issue in 2.7.10 as well. Although the list comprehension works. $ python Python 2.7.10 (default, Oct 6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin Type "help",

[issue35871] Pdb NameError in generator param and list comprehension

2019-01-31 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the report. This seems related to issue21161 and issue26072 that contain explanation about scope where exec is called with the code and patches that fix this issue. As a possible workaround in the issues you can use "interact" command

[issue35871] Pdb NameError in generator param and list comprehension

2019-01-31 Thread Jayanth Raman
New submission from Jayanth Raman : I get a NameError for a variable in the generator param of a function or in a list comprehension. See example below. The variable is available to the program, but not to the interactive Pdb shell. # Test file: def main(nn=10): xx = list(range(nn))