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 name 'items' is not defined

I can express that in a lambda expression (i.e. pass items as an argument) but 
this seems unnecessary and very inelegant.

----------
components: Interpreter Core
messages: 215595
nosy: kay
priority: normal
severity: normal
status: open
title: list comprehensions don't see local variables in pdb in python3
versions: Python 3.1, Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21161>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to