PEP 661: Add missing sections and correctly populate Post-History (#4050)

This commit is contained in:
Tal Einat 2024-10-13 23:50:07 +03:00 committed by GitHub
parent e43cb850dd
commit 9af6b95a52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 42 additions and 3 deletions

View File

@ -6,7 +6,7 @@ Status: Draft
Type: Standards Track Type: Standards Track
Content-Type: text/x-rst Content-Type: text/x-rst
Created: 06-Jun-2021 Created: 06-Jun-2021
Post-History: 06-Jun-2021 Post-History: `20-May-2021 <https://discuss.python.org/t/sentinel-values-in-the-stdlib/8810>`__, `06-Jun-2021 <https://discuss.python.org/t/pep-661-sentinel-values/9126>`__
TL;DR: See the `Specification`_ and `Reference Implementation`_. TL;DR: See the `Specification`_ and `Reference Implementation`_.
@ -195,6 +195,35 @@ add minimal complexity.
Ordering comparisons are undefined for sentinel objects. Ordering comparisons are undefined for sentinel objects.
Backwards Compatibility
=======================
While not breaking existing code, adding a new "sentinels" stdlib module could
cause some confusion with regard to existing modules named "sentinels", and
specifically with the "sentinels" package on PyPI.
The existing "sentinels" package on PyPI [10]_ appears to be abandoned, with
the latest release being made on Aug. 2016. Therefore, using this name for a
new stdlib module seems reasonable.
If and when this PEP is accepted, it may be worth verifying if this has indeed
been abandoned, and if so asking to transfer ownership to the CPython
maintainers to reduce the potential for confusion with the new stdlib module.
How to Teach This
=================
The normal types of documentation of new stdlib modules and features, namely
doc-strings, module docs and a section in "What's New", should suffice.
Security Implications
=====================
This proposal should have no security implications.
Reference Implementation Reference Implementation
======================== ========================
@ -385,8 +414,17 @@ Additional Notes
for these sentinels, where different options were discussed. for these sentinels, where different options were discussed.
References Open Issues
========== ===========
* **Is adding a new stdlib module the right way to go?** I could not find any
existing module which seems like a logical place for this. However, adding
new stdlib modules should be done judiciously, so perhaps choosing an
existing module would be preferable even if it is not a perfect fit?
Footnotes
=========
.. [1] Python-Dev mailing list: `The repr of a sentinel <https://mail.python.org/archives/list/python-dev@python.org/thread/ZLVPD2OISI7M4POMTR2FCQTE6TPMPTO3/>`_ .. [1] Python-Dev mailing list: `The repr of a sentinel <https://mail.python.org/archives/list/python-dev@python.org/thread/ZLVPD2OISI7M4POMTR2FCQTE6TPMPTO3/>`_
.. [2] Python-Dev mailing list: `"The stdlib contains tons of sentinels" <https://mail.python.org/archives/list/python-dev@python.org/message/JBYXQH3NV3YBF7P2HLHB5CD6V3GVTY55/>`_ .. [2] Python-Dev mailing list: `"The stdlib contains tons of sentinels" <https://mail.python.org/archives/list/python-dev@python.org/message/JBYXQH3NV3YBF7P2HLHB5CD6V3GVTY55/>`_
@ -397,6 +435,7 @@ References
.. [7] `Reference implementation at the taleinat/python-stdlib-sentinels GitHub repo <https://github.com/taleinat/python-stdlib-sentinels>`_ .. [7] `Reference implementation at the taleinat/python-stdlib-sentinels GitHub repo <https://github.com/taleinat/python-stdlib-sentinels>`_
.. [8] `bpo-35712: Make NotImplemented unusable in boolean context <https://github.com/python/cpython/issues/79893>`_ .. [8] `bpo-35712: Make NotImplemented unusable in boolean context <https://github.com/python/cpython/issues/79893>`_
.. [9] `Discussion thread about type signatures for these sentinels on the typing-sig mailing list <https://mail.python.org/archives/list/typing-sig@python.org/thread/NDEJ7UCDPINP634GXWDARVMTGDVSNBKV/#LVCPTY26JQJW7NKGKGAZXHQKWVW7GOGL>`_ .. [9] `Discussion thread about type signatures for these sentinels on the typing-sig mailing list <https://mail.python.org/archives/list/typing-sig@python.org/thread/NDEJ7UCDPINP634GXWDARVMTGDVSNBKV/#LVCPTY26JQJW7NKGKGAZXHQKWVW7GOGL>`_
.. [10] `sentinels package on PyPI <https://pypi.org/project/sentinels/>`_
Copyright Copyright