Nathaniel Smith added the comment: > 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30744> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com