PEP 667: Remove open issues section, as the issues have been resolved (#3731)
This commit is contained in:
parent
b9c97a4319
commit
ec21ce3471
|
@ -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
|
||||
==============
|
||||
|
|
Loading…
Reference in New Issue