[issue21161] list comprehensions don't see local variables in pdb in python3

2019-12-05 Thread Andreas Kloeckner
Change by Andreas Kloeckner : -- nosy: +inducer ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue21161] list comprehensions don't see local variables in pdb in python3

2019-08-09 Thread daniel hahler
Change by daniel hahler : -- pull_requests: +14926 pull_request: https://github.com/python/cpython/pull/15194 ___ Python tracker ___ ___

[issue21161] list comprehensions don't see local variables in pdb in python3

2019-07-31 Thread daniel hahler
daniel hahler added the comment: Georg, please consider re-opening. This patch here appears to fix this after all. -- nosy: +blueyed versions: +Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker _

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-12-02 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-05-20 Thread Xavier de Gaye
Xavier de Gaye added the comment: The patch fails to invoke exec() with the locals argument set to the current frame locals. The attached patch fixes this, and test_pdb runs now fine with it. -- Added file: http://bugs.python.org/file35305/default.patch

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-14 Thread Xavier de Gaye
Xavier de Gaye added the comment: Interestingly, the interact command was added at changeset: $ hg log -v --pager cat -r $(hg blame Lib/pdb.py | grep do_interact | awk -F : '{print $1}') changeset: 66691:c2578a68879d user:Georg Brandl date:Sat Dec 04 11:20:26 2010 + files

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-13 Thread Xavier de Gaye
Xavier de Gaye added the comment: The NameError exception occuring on a generator expression referencing a local variable when the generator is called within exec() is the object of multiple entries in the bug tracker, see issue 13557. msg 149096 in this issue suggests using exec(code, locals(

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-12 Thread Jurko Gospodnetić
Jurko Gospodnetić added the comment: Thanks for looking into this Xavier. Could someone reopen this issue so it can gets looked at again? -- ___ Python tracker ___ _

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-12 Thread Xavier de Gaye
Xavier de Gaye added the comment: The runcode() method of InteractiveInterpreter in code.py uses the 'self.locals' dictionary as the 'globals' parameter of the invoked exec() function. And the do_interact() method of Pdb instantiates InteractiveInterpreter with 'locals' as a merge of the curre

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-12 Thread Xavier de Gaye
Xavier de Gaye added the comment: FWIW this generator expression can be evaluated with the 'interact' command: --Return-- > /test/comprehension.py(5)foo()->None -> pdb.set_trace() (Pdb) interact *interactive* >>> all(x < limit for x in items) True >>> (Pdb) -- nosy: +xdegaye _

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-10 Thread Jurko Gospodnetić
Jurko Gospodnetić added the comment: Just ran into this problem and it's so uncomfortable researching dynamic structures at run-time using PDB without this. :-( As a workaround, you can use a trick similar to this one to 'import' your locals into the list comprehension body: [l['r'](x) for

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-05 Thread Georg Brandl
Georg Brandl added the comment: Your failure appears to be not pasted from an interpreter session; the actual failure is: (Pdb) all(x < limit for x in items) *** NameError: global name 'limit' is not defined (i.e. "limit" is not found, not "items"). This actually does not work in Python 2 ei

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-05 Thread Kay
Changes by Kay : -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-05 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-05 Thread Kay
Changes by Kay : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-05 Thread Kay
New submission from Kay: Using generators in pdb are very handy but since Python3 they don't work properly. For example: import pdb def foo(): items = [1, 2, 3] limit = 5 pdb.set_trace() foo() in pdb prompt the following fails: (pdf) all(x < limit for x in items) *** NameError: global