PEP 667: Remove open issues section, as the issues have been resolved (#3731)

This commit is contained in:
Mark Shannon 2024-03-20 12:56:19 +00:00 committed by GitHub
parent b9c97a4319
commit ec21ce3471
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 27 deletions

View File

@ -425,33 +425,6 @@ whereas this PEP does not.
:pep:`558` does not specify exactly when the internal copy is
updated, making the behavior of :pep:`558` impossible to reason about.
Open Issues
===========
Have locals() return a mapping proxy
------------------------------------
An alternative way to define ``locals()`` would be simply as::
def locals():
return sys._getframe(1).f_locals
This would be simpler and easier to understand. However,
there would be backwards compatibility issues when ``locals()`` is assigned
to a local variable or passed to ``eval`` or ``exec``.
Lifetime of the mapping proxy
-----------------------------
Each read of the ``f_locals`` attributes creates a new mapping proxy.
This is done to avoid creating a reference cycle.
An alternative would be to cache the proxy on the frame, so that
``frame.f_locals is frame.f_locals`` would be true.
The downside of this is that the reference cycle would delay collection
of both the frame and mapping proxy until the next cycle collection.
``PyEval_GetLocals()`` already creates a cycle, as it returns a borrowed reference.
Implementation
==============