On Wed, 3 Feb 2021, 10:16 pm Sven R. Kunze, <srku...@mail.de> wrote:

> Hi Mark,
>
> I've been working on a project heavily relying on frame.f_locals.
>
> Are you planning to remove it?
>

No, PEP 558 doesn't remove it, it enhances it to be a live view of the
frame state instead of an inconsistently updated snapshot.

The potential incompatibility Mark is referring to is the fact that even
optimised frames currently allow writing to arbitrary keys in
frame.f_locals and making the bound values visible to the locals() builtin
and other consumers of frame.f_locals.

For PEP 558, it's an open question as to whether that behaviour will become
limited to the PyEval_GetLocals() backwards compatible C API, with the
updated Python frame API instead throwing KeyError for attempts to write to
unknown keys on optimised frames.

Regards,
Nick.




>
> On 30.01.21 13:18, Mark Shannon wrote:
> >
> > Given that f_locals is broken, why is keeping compatibility for this
> > obscure, and probably unused case worthwhile?
> >
> > The break in compatibility with locals() seems much more intrusive,
> > yet you are OK with that (as am I).
>
>
> Best,
> Sven
>
>
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/YXW2EU5YBFLG3MSNDXW3RMTZ36GG5ZH2/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to