[Python-Dev] More comments on PEP 558

2021年1月30日 04:31:07 -0800

Hi Nick,
A couple more issues with PEP 558, as I see it.
Lack of specification
---------------------
There is no specification section in PEP 558.
Much of PEP 558 describes the differences between the current behavior and what PEP 558 proposes. These differences are often intermingled with a discussion of the flaws with the current behavior, which makes it difficult to understand what the proposed behavior is.
I could not implement PEP 558 from the PEP alone.
Cycles and the cost of maintaining the f_locals cache
-----------------------------------------------------
PEP 558 proposes that f_locals acts as a proxy mapping to the locals in a frame *and* that the frame caches the proxy. This obviously creates a cycle, which needs to be broken by the cycle GC. Although the cycle only exists if f_locals is actually used, there is still some overhead for *every* call and return, as the f_locals field needs to be initialized on call and checked for non-NULL on return.
Cheers,
Mark.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/7TKPMD5LHCBXGFUIMKDAUZELRH6EX76S/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to