Author scotchka
Recipients ppperry, scotchka, serhiy.storchaka, xtreak
Date 2019-01-18.16:31:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1547829102.96.0.0119995792663.issue34782@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2019-01-18 16:31:44scotchkasetrecipients: + scotchka, serhiy.storchaka, ppperry, xtreak
2019-01-18 16:31:42scotchkasetmessageid: <1547829102.96.0.0119995792663.issue34782@roundup.psfhosted.org>
2019-01-18 16:31:42scotchkalinkissue34782 messages
2019-01-18 16:31:42scotchkacreate