Henry Chen <taha...@gmail.com> added the comment:

An attempt to clarify the issue in my own mind:

def foo():
    # import pdb; pdb.set_trace()
    exec('pass', {}, FakeContainer())

This function runs successfully. But if you uncomment the pdb line and then 
step thru in the pdb console, there is an Exception.

I *think* the underlying principle is that code that runs normally should also 
run under pdb, which this example violates. However, to adhere to the principle 
100% could be a very steep technical cost.

Alternatively, I'd argue that the function should NOT run even without pdb, 
since exec requires a (complete) mapping type according to the documentation. 
Perhaps the thing to do is to add more stringent type checking to exec and eval?

----------

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

Reply via email to