On Wed, Apr 8, 2020 at 10:05 AM Alex Hall <alex.moj...@gmail.com> wrote:

> This would break uses of locals(), e.g.
>

Hm, okay, so suppose the code analysis was good enough to recognize most
un-obfuscated uses of locals(), exec() and eval() (and presumably
sys._getframe() -- IIUC there's already a Python implementation that
generates less optimal code for functions where it detects usage of
sys._getframe(), maybe IronPython).


> Plus if the calculation raises an exception and I'm looking at the report
> on Sentry, I'd like to see the values of all variables. In particular I
> might have expected the function to return early and I want to see what `x`
> was.
>

That's a very valid objection. For simpletons like myself who just use pdb
it could also be problematic. So at the very least there would have to be a
way to turn it off, and probably it should have to be requested explicitly
(maybe just with -O).

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/CNON3MYEASWG6WLW5C2QWRSTMQVZDDCX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to