Skip to content

Commit 938c2d2

Browse files
authored
PEP 661: Fix citation references (#2698)
1 parent c5dbd7e commit 938c2d2

File tree

1 file changed

+21
-30
lines changed

1 file changed

+21
-30
lines changed

pep-0661.rst

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ of each maintainer.
3434
Motivation
3535
==========
3636

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

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

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

72-
A poll was created on discuss.python.org [#poll]_ to get a clearer sense of
72+
A `poll was created on discuss.python.org <poll_>`__ to get a clearer sense of
7373
the community's opinions. The poll's results were not conclusive, with 40%
7474
voting for "The status-quo is fine / there’s no need for consistency in
7575
this", but most voters voting for one or more standardized solutions.
@@ -146,8 +146,8 @@ For example::
146146
Reference Implementation
147147
========================
148148

149-
The reference implementation is found in a dedicated GitHub repo
150-
[#reference-github-repo]_. A simplified version follows::
149+
The reference implementation is found in a `dedicated GitHub repo
150+
<reference-github-repo_>`__. A simplified version follows::
151151

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

206-
Finally, this was a very unpopular option in the poll [#poll]_, with only 12%
206+
Finally, this was a very unpopular option in the `poll <poll_>`__, with only 12%
207207
of the votes voting for it.
208208

209209

@@ -233,8 +233,8 @@ Besides the excessive repetition, the repr is overly long:
233233
``<NotGivenType.NotGiven: 'NotGiven'>``. A shorter repr can be defined, at
234234
the expense of a bit more code and yet more repetition.
235235

236-
Finally, this option was the least popular among the nine options in the poll
237-
[#poll]_, being the only option to receive no votes.
236+
Finally, this option was the least popular among the nine options in the `poll
237+
<poll_>`__, being the only option to receive no votes.
238238

239239

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

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

300300

301301
Additional Notes
302302
================
303303

304-
* This PEP and the initial implementation are drafted in a dedicated GitHub
305-
repo [#reference-github-repo]_.
304+
* This PEP and the initial implementation are drafted in a `dedicated GitHub
305+
repo <reference-github-repo_>`__.
306306

307307
* The support for copying/unpickling works when defined in a module's scope or
308308
a (possibly nested) class's scope. Note that in the latter case, the name
@@ -316,28 +316,19 @@ Additional Notes
316316
References
317317
==========
318318

319-
.. [#python-dev-thread] Python-Dev mailing list: `The repr of a sentinel <https://mail.python.org/archives/list/[email protected]/thread/ZLVPD2OISI7M4POMTR2FCQTE6TPMPTO3/>`_
320-
.. [#list-of-sentinels-in-stdlib] Python-Dev mailing list: `"The stdlib contains tons of sentinels" <https://mail.python.org/archives/list/[email protected]/message/JBYXQH3NV3YBF7P2HLHB5CD6V3GVTY55/>`_
321-
.. [#poll] discuss.python.org Poll: `Sentinel Values in the Stdlib <https://discuss.python.org/t/sentinel-values-in-the-stdlib/8810/>`_
322-
.. [#reference-github-repo] `Reference implementation at the taleinat/python-stdlib-sentinels GitHub repo <https://github.com/taleinat/python-stdlib-sentinels>`_
323-
.. [5] `bpo-44123: Make function parameter sentinel values true singletons <https://bugs.python.org/issue44123>`_
324-
.. [6] `The "sentinels" package on PyPI <https://pypi.org/project/sentinels/>`_
325-
.. [7] `The "sentinel" package on PyPI <https://pypi.org/project/sentinel/>`_
326-
.. [8] `Discussion thread about type signatures for these sentinels on the typing-sig mailing list <https://mail.python.org/archives/list/[email protected]/thread/NDEJ7UCDPINP634GXWDARVMTGDVSNBKV/#LVCPTY26JQJW7NKGKGAZXHQKWVW7GOGL>`_
319+
.. _python-dev-thread: https://mail.python.org/archives/list/[email protected]/thread/ZLVPD2OISI7M4POMTR2FCQTE6TPMPTO3/
320+
.. _list-of-sentinels-in-stdlib: https://mail.python.org/archives/list/[email protected]/message/JBYXQH3NV3YBF7P2HLHB5CD6V3GVTY55/
321+
.. _poll: https://discuss.python.org/t/sentinel-values-in-the-stdlib/8810/
322+
.. _reference-github-repo: https://github.com/taleinat/python-stdlib-sentinels
323+
324+
* `bpo-44123: Make function parameter sentinel values true singletons <https://bugs.python.org/issue44123>`_
325+
* `The "sentinels" package on PyPI <https://pypi.org/project/sentinels/>`_
326+
* `The "sentinel" package on PyPI <https://pypi.org/project/sentinel/>`_
327+
* `Discussion thread about type signatures for these sentinels on the typing-sig mailing list <https://mail.python.org/archives/list/[email protected]/thread/NDEJ7UCDPINP634GXWDARVMTGDVSNBKV/#LVCPTY26JQJW7NKGKGAZXHQKWVW7GOGL>`_
327328

328329

329330
Copyright
330331
=========
331332

332333
This document is placed in the public domain or under the
333334
CC0-1.0-Universal license, whichever is more permissive.
334-
335-
336-
..
337-
Local Variables:
338-
mode: indented-text
339-
indent-tabs-mode: nil
340-
sentence-end-double-space: t
341-
fill-column: 70
342-
coding: utf-8
343-
End:

0 commit comments

Comments
 (0)