Skip to content

Commit a2890cf

Browse files
authored
PEP 621, 635, 637, 639, 642, 644, 645, 647, 650: Fix single backticks (#1797)
1 parent 814daa8 commit a2890cf

File tree

9 files changed

+32
-32
lines changed

9 files changed

+32
-32
lines changed

pep-0621.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ then tools MUST raise an error to notify the user about their mistake.
104104

105105
Data specified using this PEP is considered canonical. Tools CANNOT
106106
remove, add or change data that has been statically specified. Only
107-
when a field is marked as `dynamic` may a tool provide a "new" value.
107+
when a field is marked as ``dynamic`` may a tool provide a "new" value.
108108

109109

110110
Details

pep-0635.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ overall pattern fails, which is not feasible.
939939

940940
To identify sequences we cannot rely on ``len()`` and subscripting and
941941
slicing alone, because sequences share these protocols with mappings
942-
(e.g. `dict`) in this regard. It would be surprising if a sequence
942+
(e.g. ``dict``) in this regard. It would be surprising if a sequence
943943
pattern also matched a dictionaries or other objects implementing
944944
the mapping protocol (i.e. ``__getitem__``). The interpreter therefore
945945
performs an instance check to ensure that the subject in question really
@@ -1141,7 +1141,7 @@ organised structured data in 'tagged tuples' rather than ``struct`` as in
11411141
instance, be a tuple with two elements for the left and right branches,
11421142
respectively, and a ``Node`` tag, written as ``Node(left, right)``. In
11431143
Python we would probably put the tag inside the tuple as
1144-
``('Node', left, right)`` or define a data class `Node` to achieve the
1144+
``('Node', left, right)`` or define a data class ``Node`` to achieve the
11451145
same effect.
11461146

11471147
Using modern syntax, a depth-first tree traversal would then be written as
@@ -1216,7 +1216,7 @@ indicator if it is not possible.
12161216

12171217
In Python, we simply use ``isinstance()`` together with the ``__match_args__``
12181218
field of a class to check whether an object has the correct structure and
1219-
then transform some of its attributes into a tuple. For the `Node` example
1219+
then transform some of its attributes into a tuple. For the ``Node`` example
12201220
above, for instance, we would have ``__match_args__ = ('left', 'right')`` to
12211221
indicate that these two attributes should be extracted to form the tuple.
12221222
That is, ``case Node(x, y)`` would first check whether a given object is an
@@ -1229,7 +1229,7 @@ specific attributes. Instead of ``Node(x, y)`` you could also write
12291229
``object(left=x, right=y)``, effectively eliminating the ``isinstance()``
12301230
check and thus supporting any object with ``left`` and ``right`` attributes.
12311231
Or you would combine these ideas to write ``Node(right=y)`` so as to require
1232-
an instance of ``Node`` but only extract the value of the `right` attribute.
1232+
an instance of ``Node`` but only extract the value of the ``right`` attribute.
12331233

12341234

12351235
Backwards Compatibility

pep-0637.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ Allowing for empty index notation obj[]
856856
The current proposal prevents ``obj[]`` from being valid notation. However
857857
a commenter stated
858858

859-
We have ``Tuple[int, int]`` as a tuple of two integers. And we have `Tuple[int]`
859+
We have ``Tuple[int, int]`` as a tuple of two integers. And we have ``Tuple[int]``
860860
as a tuple of one integer. And occasionally we need to spell a tuple of *no*
861861
values, since that's the type of ``()``. But we currently are forced to write
862862
that as ``Tuple[()]``. If we allowed ``Tuple[]`` that odd edge case would be

pep-0639.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ gently teach users how to provide correct license expressions over time.
392392
Tools may also help with the conversion and suggest a license expression in some
393393
cases:
394394

395-
1. The section `Mapping Legacy Classifiers to New License expressions` provides
395+
1. The section `Mapping Legacy Classifiers to New License expressions`_ provides
396396
tool authors with guidelines on how to suggest a license expression produced
397397
from legacy classifiers.
398398

@@ -444,8 +444,8 @@ A mapping would be needed as you cannot guarantee that all expressions (e.g.
444444
GPL with an exception may be in a single file) or all the license keys have a
445445
single license file and that any expression does not have more than one. (e.g.
446446
an Apache license ``LICENSE`` and its ``NOTICE`` file for instance are two
447-
distinct files). Yet in most cases, there is a simpler `one license`, `one or
448-
more license files`. In the rarer and more complex cases where there are many
447+
distinct files). Yet in most cases, there is a simpler "one license", "one or
448+
more license files". In the rarer and more complex cases where there are many
449449
licenses involved you can still use the proposed conventions at the cost of a
450450
slight loss of clarity by not specifying which text file is for which license
451451
identifier, but you are not forcing the more complex data model (e.g. a mapping)
@@ -601,7 +601,7 @@ In Python code files
601601
(Note: Documenting licenses in source code is not in the scope of this PEP)
602602

603603
Beside using comments and/or ``SPDX-License-Identifier`` conventions, the license
604-
is sometimes documented in Python code files using `dunder` variables typically
604+
is sometimes documented in Python code files using "dunder" variables typically
605605
named after one of the lower cased Core Metadata fields such as ``__license__``
606606
[#pycode]_.
607607

@@ -613,7 +613,7 @@ the ``help()`` DATA section for a module.
613613
In some other Python packaging tools
614614
------------------------------------
615615

616-
- `Conda package manifest` [#conda]_ has support for ``license`` and ``license_file``
616+
- Conda package manifest [#conda]_ has support for ``license`` and ``license_file``
617617
fields as well as a ``license_family`` license grouping field.
618618

619619
- ``flit`` [#flit]_ recommends to use classifiers instead of License (as per the

pep-0642.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ then we don't have any real way to revisit those decisions in a future release.
191191
Specification
192192
=============
193193

194-
This PEP retains the overall `match`/`case` statement structure and semantics
194+
This PEP retains the overall ``match``/``case`` statement structure and semantics
195195
from PEP 634, but proposes multiple changes that mean that user intent is
196196
explicitly specified in the concrete syntax rather than needing to be inferred
197197
from the pattern matching context.
@@ -2007,7 +2007,7 @@ The following new nodes are added to the AST by this PEP::
20072007
Appendix C: Summary of changes relative to PEP 634
20082008
==================================================
20092009

2010-
The overall `match`/`case` statement syntax and the guard expression syntax
2010+
The overall ``match``/``case`` statement syntax and the guard expression syntax
20112011
remain the same as they are in PEP 634.
20122012

20132013
Relative to PEP 634 this PEP makes the following key changes:

pep-0644.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ incompatible forks, and other TLS libraries are dropped.
2222
Motivation
2323
==========
2424

25-
Python makes use of OpenSSL in `hashlib`, `hmac`, and `ssl` modules. OpenSSL
25+
Python makes use of OpenSSL in ``hashlib``, ``hmac``, and ``ssl`` modules. OpenSSL
2626
provides fast implementations of cryptographic primitives and a full TLS
27-
stack including handling of X.509 certificates. The `ssl` module is used by
28-
standard library modules like `urllib` and 3rd party modules like `urllib3`
29-
to implement secure variants of internet protocols. `pip` uses the `ssl`
30-
module to securely download packages from PyPI. Any bug in the ssl module's
27+
stack including handling of X.509 certificates. The ``ssl`` module is used by
28+
standard library modules like ``urllib`` and 3rd party modules like ``urllib3``
29+
to implement secure variants of internet protocols. ``pip`` uses the ``ssl``
30+
module to securely download packages from PyPI. Any bug in the ``ssl`` module's
3131
bindings to OpenSSL can lead to a severe security issue.
3232

3333
Over time OpenSSL's public API has evolved and changed. Version 1.0.2
@@ -164,7 +164,7 @@ created: 2014-04 (forked from OpenSSL 1.0.1g)
164164
Some distributions like FreeBSD, Gentoo, and OPNsense also feature LibreSSL
165165
instead of OpenSSL as non-standard TLS libraries.
166166

167-
OpenBSD ports has a port `security/openssl/1.1` which is documented as
167+
OpenBSD ports has a port ``security/openssl/1.1`` which is documented as
168168
"[...] is present to provide support for applications which cannot be made
169169
compatible with LibReSSL" [7]_. The package could be used by OpenBSD to
170170
provide a working ssl module.
@@ -203,9 +203,9 @@ SHA-3
203203

204204
Since 1.1.0, OpenSSL ships with SHA-3 and SHAKE implementations.
205205
Python's builtin SHA-3 support is based on the reference implementation. The
206-
internal `_sha3` code is fairly large and the resulting shared library close
206+
internal ``_sha3`` code is fairly large and the resulting shared library close
207207
to 0.5 MB. Python could drop the builtin implementation and rely on OpenSSL's
208-
`libcrypto` instead.
208+
``libcrypto`` instead.
209209

210210
So far LibreSSL upstream development has refused to add SHA-3 support. [2]_
211211

@@ -217,7 +217,7 @@ OpenSSL downstream patches and options
217217
--------------------------------------
218218

219219
OpenSSL features more than 70 configure and build time options in the form
220-
of `OPENSSL_NO_*` macros. Around 60 options affect the presence of features
220+
of ``OPENSSL_NO_*`` macros. Around 60 options affect the presence of features
221221
like cryptographic algorithms and TLS versions. Some distributions apply
222222
patches to alter settings. Furthermore, default values for settings like
223223
security level, ciphers, TLS version range, and signature algorithms can
@@ -227,8 +227,8 @@ The Python core team lacks resources to test all possible combinations.
227227
This PEP proposes that Python only supports OpenSSL builds that have
228228
standard features enabled. Vendors shall disable deprecated or insecure
229229
algorithms and TLS versions with build time options like
230-
`OPENSSL_NO_TLS1_1_METHOD` or OpenSSL config options like
231-
`MinProtocol = TLSv1.2`.
230+
``OPENSSL_NO_TLS1_1_METHOD`` or OpenSSL config options like
231+
``MinProtocol = TLSv1.2``.
232232

233233
Python assumes that OpenSSL is built with
234234

@@ -260,7 +260,7 @@ latest release LibreSSL 3.3.2 is missing features and behaves differently
260260
in some cases. Mentionable missing or incompatible features include
261261

262262
- SHA-3, SHAKE, BLAKE2
263-
- `SSL_CERT_*` environment variables
263+
- ``SSL_CERT_*`` environment variables
264264
- security level APIs
265265
- session handling APIs
266266
- key logging API

pep-0645.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ The widespread adoption and popularity of these languages means that Python deve
5959
// Optional in C#
6060
string? example;
6161

62-
Adding this syntax would also follow the often used pattern of using builtin types as annotations. For example, `list`, `dict` and `None`. This would allow more annotations to be
63-
added to Python code without importing from `typing`.
62+
Adding this syntax would also follow the often used pattern of using builtin types as annotations. For example, ``list``, ``dict`` and ``None``. This would allow more annotations to be
63+
added to Python code without importing from ``typing``.
6464

6565

6666
Specification
@@ -107,7 +107,7 @@ Since the new Union syntax specified in PEP 604 is supported in ``isinstance`` a
107107
isinstance(1, int?) # true
108108
issubclass(Child, Super?) # true
109109

110-
A new dunder method will need to be implemented to allow the `?` operator to be overloaded for other functionality.
110+
A new dunder method will need to be implemented to allow the ``?`` operator to be overloaded for other functionality.
111111

112112

113113
Backwards Compatibility

pep-0647.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ narrowed within the conditional code block.
205205

206206
Some built-in type guards provide narrowing for both positive and negative
207207
tests (in both the ``if`` and ``else`` clauses). For example, consider the
208-
type guard for an expression of the form `x is None`. If `x` has a type that
209-
is a union of None and some other type, it will be narrowed to `None` in the
208+
type guard for an expression of the form ``x is None``. If ``x`` has a type that
209+
is a union of None and some other type, it will be narrowed to ``None`` in the
210210
positive case and the other type in the negative case. User-defined type
211211
guards apply narrowing only in the positive case (the ``if`` clause). The type
212212
is not narrowed in the negative case.

pep-0650.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,8 @@ though, it was considered an orthogonal idea.
597597
Open Issues
598598
===========
599599

600-
Should the `dependency_group` argument take an iterable?
601-
--------------------------------------------------------
600+
Should the ``dependency_group`` argument take an iterable?
601+
----------------------------------------------------------
602602

603603
This would allow for specifying non-overlapping dependency groups in
604604
a single call, e.g. "docs" and "test" groups which have independent

0 commit comments

Comments
 (0)