Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
PEP 661: Inline the references anonymously
  • Loading branch information
hugovk committed Jul 6, 2022
commit 58e5911064d12a5a9b5116a00e4ae5869b199634
16 changes: 8 additions & 8 deletions pep-0661.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Motivation
==========

In May 2021, a question was brought up on the `python-dev mailing list
<python-dev-thread_>`_ about how to better implement a sentinel value for
<python-dev-thread_>`__ about how to better implement a sentinel value for
``traceback.print_exception``. The existing implementation used the
following common idiom::

Expand All @@ -60,7 +60,7 @@ in the discussion:
instance being created and thus comparisons using ``is`` failing

In the ensuing discussion, Victor Stinner supplied a list of currently used
`sentinel values in the Python standard library <list-of-sentinels-in-stdlib_>`_.
`sentinel values in the Python standard library <list-of-sentinels-in-stdlib_>`__.
This showed that the need for sentinels is fairly common, that there are
various implementation methods used even within the stdlib, and that many of
these suffer from at least one of the aforementioned drawbacks.
Expand All @@ -69,7 +69,7 @@ The discussion did not lead to any clear consensus on whether a standard
implementation method is needed or desirable, whether the drawbacks mentioned
are significant, nor which kind of implementation would be good.

A `poll was created on discuss.python.org <poll_>`_ to get a clearer sense of
A `poll was created on discuss.python.org <poll_>`__ to get a clearer sense of
the community's opinions. The poll's results were not conclusive, with 40%
voting for "The status-quo is fine / there’s no need for consistency in
this", but most voters voting for one or more standardized solutions.
Expand Down Expand Up @@ -147,7 +147,7 @@ Reference Implementation
========================

The reference implementation is found in a `dedicated GitHub repo
<reference-github-repo_>`_. A simplified version follows::
<reference-github-repo_>`__. A simplified version follows::

def sentinel(name, repr=None):
"""Create a unique sentinel object."""
Expand Down Expand Up @@ -203,7 +203,7 @@ with confidence without needing to consider potential edge-cases.
Additionally, it is useful to be able to provide a meaningful name and repr
for a sentinel value, specific to the context where it is used.

Finally, this was a very unpopular option in the `poll <poll_>`_, with only 12%
Finally, this was a very unpopular option in the `poll <poll_>`__, with only 12%
of the votes voting for it.


Expand Down Expand Up @@ -234,7 +234,7 @@ Besides the excessive repetition, the repr is overly long:
the expense of a bit more code and yet more repetition.

Finally, this option was the least popular among the nine options in the `poll
<poll_>`_, being the only option to receive no votes.
<poll_>`__, being the only option to receive no votes.


A sentinel class decorator
Expand Down Expand Up @@ -293,7 +293,7 @@ Define a recommended "standard" idiom, without supplying an implementation
Most common exiting idioms have significant drawbacks. So far, no idiom
has been found that is clear and concise while avoiding these drawbacks.

Also, in the `poll on this subject <poll_>`_, the options for recommending an
Also, in the `poll on this subject <poll_>`__, the options for recommending an
idiom were unpopular, with the highest-voted option being voted for by only
25% of the voters.

Expand All @@ -302,7 +302,7 @@ Additional Notes
================

* This PEP and the initial implementation are drafted in a `dedicated GitHub
repo <reference-github-repo_>`_.
repo <reference-github-repo_>`__.

* The support for copying/unpickling works when defined in a module's scope or
a (possibly nested) class's scope. Note that in the latter case, the name
Expand Down