Message297145
> 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. | |
| Date | User | Action | Args | | 2017-06-28 03:36:21 | njs | set | recipients: + njs, arigo, ncoghlan, belopolsky, vstinner, benjamin.peterson, Mark.Shannon, yselivanov, xgdomingo | | 2017-06-28 03:36:21 | njs | set | messageid: <1498620981.75.0.221862495874.issue30744@psf.upfronthosting.co.za> | | 2017-06-28 03:36:21 | njs | link | issue30744 messages | | 2017-06-28 03:36:21 | njs | create | | |