@@ -2,11 +2,12 @@ PEP: 820
22Title: PySlot: Unified slot system for the C API
33Author: Petr Viktorin <encukou@gmail.com>
44Discussions-To: https://discuss.python.org/t/105552
5- Status: Draft
5+ Status: Accepted
66Type: Standards Track
77Created: 19-Dec-2025
88Python-Version: 3.15
99Post-History: `06-Jan-2026 <https://discuss.python.org/t/105552 >`__
10+ Resolution: `23-Apr-2025 <https://discuss.python.org/t/105552/24 >`__
1011
1112
1213.. highlight :: c
@@ -143,7 +144,7 @@ which can be specified as C literals using macros, like this::
143144
144145 // ...
145146
146- PyObject *MyClass = PyType_FromSlots(myClass_slots, -1 );
147+ PyObject *MyClass = PyType_FromSlots(myClass_slots);
147148
148149The macros simplify hand-written literals.
149150For more complex use cases, like compatibility between several Python versions,
@@ -327,6 +328,8 @@ the same effect.
327328To allow changing the edge case behaviour in the (far) future,
328329and to allow freedom for possible alternative implementations of the C API,
329330we'll start issuing runtime deprecation warnings in these cases.
331+ To avoid flooding users with warnings for things that are outside of their
332+ control, we'll only show deprecation warnings when the new API is used.
330333
331334
332335Specification
@@ -483,7 +486,7 @@ Each ``PyType_Slot`` in the array will be converted to
483486and similar with ``PyModuleDef_Slot ``.
484487
485488In the initial implementation, nesting depth will be limited to 5 levels.
486- This restrictions may be lifted in the future.
489+ This restriction may be lifted in the future.
487490
488491
489492New slot IDs
@@ -585,9 +588,10 @@ This includes nested "new-style" slots (``Py_slot_subslots``).
585588Deprecation warnings
586589--------------------
587590
588- CPython will emit runtime deprecation warnings for the following cases,
589- for slots where the case is currently disallowed in documentation but allowed
590- by the runtime:
591+ Functions that take ``PySlot `` arrays (but not functions that take
592+ the older ``PyType_Slot `` or ``PyModuleDef_Slot `` arrays) will emit runtime
593+ deprecation warnings for the following cases, for slots where the case is
594+ currently disallowed in documentation but allowed by the runtime:
591595
592596- setting a slot value to NULL:
593597
@@ -739,6 +743,10 @@ for substantial input on this iteration of the proposal.
739743Change History
740744==============
741745
746+ * 24-Apr-2026
747+ - Limit deprecation for NULL and repeated slots to the new API.
748+ - PEP is accepted
749+
742750* `12-Mar-2026 <https://discuss.python.org/t/105552/12 >`__
743751 - Remove unnecessary flag ``PySlot_HAS_FALLBACK ``
744752
0 commit comments