This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author njs
Recipients Mark.Shannon, arigo, belopolsky, benjamin.peterson, ncoghlan, njs, vstinner, xgdomingo, yselivanov
Date 2017-06-28.03:36:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1498620981.75.0.221862495874.issue30744@psf.upfronthosting.co.za>
In-reply-to
Content
> Folks that actually *wanted* the old behaviour would then need to do either "sys._getframe().f_locals" or "inspect.currentframe().f_locals".

So by making locals() and f_locals have different semantics, we'd be adding yet another user-visible special-case? That seems unfortunate to me.

> if you want to write access to a function namespace from outside the function, you need to either implement an eval hook (not just a tracing hook)
[...]
> or else a decision to disallow write-backs to frame locals even from tracing functions in 3.7+.

Disallowing writeback from tracing functions would completely break bdb/pdb, so unless you're planning to rewrite bdb in C as an eval hook, then I don't think this is going to happen :-). Writing back to locals is a useful and important feature!

I think I'm missing some rationale here for why you prefer this approach – it seems much more complicated in terms of user-visible semantics, and possibly implementation-wise as well.
History
Date User Action Args
2017-06-28 03:36:21njssetrecipients: + njs, arigo, ncoghlan, belopolsky, vstinner, benjamin.peterson, Mark.Shannon, yselivanov, xgdomingo
2017-06-28 03:36:21njssetmessageid: <1498620981.75.0.221862495874.issue30744@psf.upfronthosting.co.za>
2017-06-28 03:36:21njslinkissue30744 messages
2017-06-28 03:36:21njscreate