Skip to content

Commit 85c4c86

Browse files
authored
PEP 484: Fix citation references (#2638)
1 parent 9ef0bfe commit 85c4c86

File tree

1 file changed

+29
-48
lines changed

1 file changed

+29
-48
lines changed

pep-0484.txt

+29-48
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Essentially, such a type checker acts as a very powerful linter.
4646
a similar checker at run time for Design By Contract enforcement or
4747
JIT optimization, those tools are not yet as mature.)
4848

49-
The proposal is strongly inspired by mypy [mypy]_. For example, the
49+
The proposal is strongly inspired by `mypy <mypy_>`_. For example, the
5050
type "sequence of integers" can be written as ``Sequence[int]``. The
5151
square brackets mean that no new syntax needs to be added to the
5252
language. The example here uses a custom type ``Sequence``, imported
@@ -68,8 +68,8 @@ Rationale and Goals
6868

6969
:pep:`3107` added support for arbitrary annotations on parts of a
7070
function definition. Although no meaning was assigned to annotations
71-
then, there has always been an implicit goal to use them for type
72-
hinting [gvr-artima]_, which is listed as the first possible use case
71+
then, there has always been an `implicit goal to use them for type
72+
hinting <gvr-artima_>`_, which is listed as the first possible use case
7373
in said PEP.
7474

7575
This PEP aims to provide a standard syntax for type annotations,
@@ -760,8 +760,8 @@ to the list, which would violate the variable's type in the caller.
760760
It turns out such an argument acts *contravariantly*, whereas the
761761
intuitive answer (which is correct in case the function doesn't mutate
762762
its argument!) requires the argument to act *covariantly*. A longer
763-
introduction to these concepts can be found on Wikipedia
764-
[wiki-variance]_ and in :pep:`483`; here we just show how to control
763+
introduction to these concepts can be found on `Wikipedia
764+
<wiki-variance_>`_ and in :pep:`483`; here we just show how to control
765765
a type checker's behavior.
766766

767767
By default generic types are considered *invariant* in all type variables,
@@ -1660,7 +1660,7 @@ Additional notes on stub files:
16601660
exported. (This makes it easier to re-export all objects from a
16611661
given module that may vary by Python version.)
16621662

1663-
* Just like in normal Python files [importdocs]_, submodules
1663+
* Just like in `normal Python files <importdocs_>`_, submodules
16641664
automatically become exported attributes of their parent module
16651665
when imported. For example, if the ``spam`` package has the
16661666
following directory structure::
@@ -1861,8 +1861,8 @@ enabled by including a file named ``py.typed`` in the package.)
18611861
The Typeshed Repo
18621862
-----------------
18631863

1864-
There is a shared repository where useful stubs are being collected
1865-
[typeshed]_. Policies regarding the stubs collected here will be
1864+
There is a `shared repository <typeshed_>`_ where useful stubs are being
1865+
collected. Policies regarding the stubs collected here will be
18661866
decided separately and reported in the repo's documentation.
18671867
Note that stubs for a given package will not be included here
18681868
if the package owners have specifically requested that they be omitted.
@@ -2365,8 +2365,9 @@ evaluation. There are several things wrong with this idea, however.
23652365
is unheard of in English, and in other languages (e.g. C++) it is
23662366
used as a scoping operator, which is a very different beast. In
23672367
contrast, the single colon for type hints reads naturally -- and no
2368-
wonder, since it was carefully designed for this purpose (the idea
2369-
long predates :pep:`3107` [gvr-artima]_). It is also used in the same
2368+
wonder, since it was carefully designed for this purpose
2369+
(`the idea <gvr-artima_>`_
2370+
long predates :pep:`3107`). It is also used in the same
23702371
fashion in other languages from Pascal to Swift.
23712372

23722373
* What would you do for return type annotations?
@@ -2397,8 +2398,8 @@ evaluation. There are several things wrong with this idea, however.
23972398
Other forms of new syntax
23982399
-------------------------
23992400

2400-
A few other forms of alternative syntax have been proposed, e.g. the
2401-
introduction of a ``where`` keyword [roberge]_, and Cobra-inspired
2401+
A few other forms of alternative syntax have been proposed, e.g. `the
2402+
introduction <roberge_>`_ of a ``where`` keyword, and Cobra-inspired
24022403
``requires`` clauses. But these all share a problem with the double
24032404
colon: they won't work for earlier versions of Python 3. The same
24042405
would apply to a new ``__future__`` import.
@@ -2433,12 +2434,12 @@ problem would that solve? It would just be procrastination.
24332434
PEP Development Process
24342435
=======================
24352436

2436-
A live draft for this PEP lives on GitHub [github]_. There is also an
2437-
issue tracker [issues]_, where much of the technical discussion takes
2437+
A live draft for this PEP lives on `GitHub <github_>`_. There is also an
2438+
`issue tracker <issues_>`_, where much of the technical discussion takes
24382439
place.
24392440

24402441
The draft on GitHub is updated regularly in small increments. The
2441-
official PEPS repo [peps_] is (usually) only updated when a new draft
2442+
`official PEPS repo <peps_>`_ is (usually) only updated when a new draft
24422443
is posted to python-dev.
24432444

24442445

@@ -2457,55 +2458,35 @@ Anders Hejlsberg, Alok Menghrajani, Travis E. Oliphant, Joe Pamer,
24572458
Raoul-Gabriel Urma, and Julien Verlaguet.
24582459

24592460

2460-
References
2461-
==========
2462-
2463-
.. [mypy]
2461+
.. _mypy:
24642462
http://mypy-lang.org
24652463

2466-
.. [gvr-artima]
2467-
http://www.artima.com/weblogs/viewpost.jsp?thread=85551
2468-
2469-
.. [wiki-variance]
2470-
http://en.wikipedia.org/wiki/Covariance_and_contravariance_%28computer_science%29
2471-
2472-
.. [typeshed]
2473-
https://github.com/python/typeshed/
2464+
.. _gvr-artima:
2465+
https://www.artima.com/weblogs/viewpost.jsp?thread=85551
24742466

2475-
.. [pyflakes]
2476-
https://github.com/pyflakes/pyflakes/
2467+
.. _wiki-variance:
2468+
https://en.wikipedia.org/wiki/Covariance_and_contravariance_%28computer_science%29
24772469

2478-
.. [pylint]
2479-
http://www.pylint.org
2470+
.. _typeshed:
2471+
https://github.com/python/typeshed
24802472

2481-
.. [roberge]
2482-
http://aroberge.blogspot.com/2015/01/type-hinting-in-python-focus-on.html
2473+
.. _roberge:
2474+
https://aroberge.blogspot.com/2015/01/type-hinting-in-python-focus-on.html
24832475

2484-
.. [github]
2476+
.. _github:
24852477
https://github.com/python/typing
24862478

2487-
.. [issues]
2479+
.. _issues:
24882480
https://github.com/python/typing/issues
24892481

2490-
.. [peps]
2482+
.. _peps:
24912483
https://hg.python.org/peps/file/tip/pep-0484.txt
24922484

2493-
.. [importdocs]
2485+
.. _importdocs:
24942486
https://docs.python.org/3/reference/import.html#submodules
24952487

24962488

24972489
Copyright
24982490
=========
24992491

25002492
This document has been placed in the public domain.
2501-
2502-
2503-
2504-
..
2505-
Local Variables:
2506-
mode: indented-text
2507-
indent-tabs-mode: nil
2508-
sentence-end-double-space: t
2509-
fill-column: 70
2510-
coding: utf-8
2511-
End:

0 commit comments

Comments
 (0)