@@ -3,40 +3,36 @@ Title: Defined semantics for locals()
3
3
Author: Alyssa Coghlan <
[email protected] >
4
4
BDFL-Delegate: Nathaniel J. Smith
5
5
6
- Status: Deferred
6
+ Status: Withdrawn
7
7
Type: Standards Track
8
8
Content-Type: text/x-rst
9
9
Created: 08-Sep-2017
10
10
Python-Version: 3.13
11
11
Post-History: 08-Sep-2017, 22-May-2019, 30-May-2019, 30-Dec-2019, 18-Jul-2021,
12
12
26-Aug-2021
13
13
14
- PEP Deferral
15
- ============
14
+ PEP Withdrawal
15
+ ==============
16
16
17
- While the original reference implementation for this PEP served a useful purpose
18
- in determining that it * is * feasible to solve the known problems with the
19
- semantics of the `` locals() `` namespace, that implementation itself is no longer
20
- viable as an implementation of the PEP as written .
17
+ In December 2021, this PEP and :pep: ` 667 ` converged on a common definition of the
18
+ proposed changes to the Python level semantics of the `` locals() `` builtin (as
19
+ documented in the PEP text below), with the only remaining differences being
20
+ in the proposed C API changes and various internal implementation details .
21
21
22
- This situation came about for two main reasons:
22
+ Of those remaining differences, the most significant one was that :pep: `667 `
23
+ at the time still proposed an immediate backwards compatibility break for the
24
+ ``PyEval_GetLocals() `` API as soon as the PEP was accepted and implemented.
23
25
24
- * first, several key parts of the original implementation were invalidated when
25
- the semantic improvements arising from the development of :pep: `667 ` resulted in
26
- the proposal in the PEP diverging from what had previously been implemented
27
- * second, several remaining practical aspects of the original implementation were
28
- invalidated by the frame management changes that formed part of the significant
29
- performance improvements published in the CPython 3.11 release, so the development
30
- branch doesn't even offer a useful starting point for an updated implementation
26
+ :pep: `667 ` has since been changed to propose a generous deprecation period for
27
+ the ``PyEval_GetLocals() `` API, continuing to support it in parallel with the
28
+ improved semantics offered by the new ``PyEval_GetFrameLocals() `` API.
31
29
32
- As a result, further progress on this PEP requires the development of a new reference
33
- implementation, either for this PEP or for :pep: ` 667 ` (the semantics of the two PEPs
34
- are so close together now that an implementation for either would require only a few
35
- relatively small changes to instead implement the other) .
30
+ Any remaining C API design concerns relate to new informational APIs that can be
31
+ added at a later date if they are deemed necessary, and any potential concerns
32
+ about the exact performance characteristics of the frame locals view implementation
33
+ are outweighed by the availability of a viable reference implementation .
36
34
37
- Since the PEP author has no current plans to produce that new reference implementation
38
- themselves, but the semantics proposed by the PEPs seem generally acceptable to the
39
- Python core development team, the most appropriate state for the PEP is "Deferred".
35
+ Accordingly, this PEP has been withdrawn in favour of proceeding with :pep: `667 `.
40
36
41
37
Abstract
42
38
========
@@ -984,6 +980,10 @@ flexibility in how they provide those capabilities.
984
980
Comparison with PEP 667
985
981
-----------------------
986
982
983
+ NOTE: the comparison below is against PEP 667 as it was in December 2021.
984
+ It does not reflect the state of PEP 667 as of April 2024 (when this PEP was
985
+ withdrawn in favour of proceeding with PEP 667).
986
+
987
987
:pep: `667 ` offers a partially competing proposal for this PEP that suggests it
988
988
would be reasonable to eliminate the internal frame value cache on optimised
989
989
frames entirely.
0 commit comments