Message297145
| 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. |
|