Skip to content

Commit 05b4d1e

Browse files
cobaltt7BojunChai
andauthored
docs: update deprecated PEP URLs to peps.python.org (#5115)
Co-authored-by: Bojun Chai <bojunchai@microsoft.com>
1 parent 1c25a47 commit 05b4d1e

4 files changed

Lines changed: 14 additions & 15 deletions

File tree

docs/guides/using_black_with_other_tools.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ profile = black
138138

139139
[pycodestyle](https://pycodestyle.pycqa.org/) is a code linter. It warns you of syntax
140140
errors, possible bugs, stylistic errors, etc. For the most part, pycodestyle follows
141-
[PEP 8](https://www.python.org/dev/peps/pep-0008/) when warning about stylistic errors.
142-
There are a few deviations that cause incompatibilities with _Black_.
141+
[PEP 8](https://peps.python.org/pep-0008/) when warning about stylistic errors. There
142+
are a few deviations that cause incompatibilities with _Black_.
143143

144144
#### Configuration
145145

docs/the_black_code_style/current_style.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ standalone comments that immediately precede the given function/class.
205205

206206
_Black_ will enforce single empty lines between a class-level docstring and the first
207207
following field or method. This conforms to
208-
[PEP 257](https://www.python.org/dev/peps/pep-0257/#multi-line-docstrings).
208+
[PEP 257](https://peps.python.org/pep-0257/#multi-line-docstrings).
209209

210210
_Black_ won't insert empty lines after function docstrings unless that empty line is
211211
required due to an inner function starting immediately after.
@@ -263,10 +263,10 @@ _Black_ to merge consecutive string literals that ended up on the same line (see
263263

264264
Why settle on double quotes? They anticipate apostrophes in English text. They match the
265265
docstring standard described in
266-
[PEP 257](https://www.python.org/dev/peps/pep-0257/#what-is-a-docstring). An empty
267-
string in double quotes (`""`) is impossible to confuse with a one double-quote
268-
regardless of fonts and syntax highlighting used. On top of this, double quotes for
269-
strings are consistent with C which Python interacts a lot with.
266+
[PEP 257](https://peps.python.org/pep-0257/#what-is-a-docstring). An empty string in
267+
double quotes (`""`) is impossible to confuse with a one double-quote regardless of
268+
fonts and syntax highlighting used. On top of this, double quotes for strings are
269+
consistent with C which Python interacts a lot with.
270270

271271
On certain keyboard layouts like US English, typing single quotes is a bit easier than
272272
double quotes. The latter requires use of the Shift key. My recommendation here is to
@@ -295,7 +295,7 @@ parts and uppercase letters for the digits themselves: `0xAB` instead of `0XAB`
295295

296296
_Black_ will break a line before a binary operator when splitting a block of code over
297297
multiple lines. This is so that _Black_ is compliant with the recent changes in the
298-
[PEP 8](https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator)
298+
[PEP 8](https://peps.python.org/pep-0008/#should-a-line-break-before-or-after-a-binary-operator)
299299
style guide, which emphasizes that this approach improves readability.
300300

301301
Almost all operators will be surrounded by single spaces, the only exceptions are unary
@@ -321,7 +321,7 @@ h = config['base'] ** 2
321321
### Slices
322322

323323
PEP 8
324-
[recommends](https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements)
324+
[recommends](https://peps.python.org/pep-0008/#whitespace-in-expressions-and-statements)
325325
to treat `:` in slices as a binary operator with the lowest priority, and to leave an
326326
equal amount of space on either side, except if a parameter is omitted (e.g.
327327
`ham[1 + 1 :]`). It recommends no spaces around `:` operators for "simple expressions"
@@ -395,7 +395,7 @@ be written in C, or they might be third-party, or their implementation may be ov
395395
dynamic, and so on).
396396

397397
To solve this,
398-
[stub files with the `.pyi` file extension](https://www.python.org/dev/peps/pep-0484/#stub-files)
398+
[stub files with the `.pyi` file extension](https://peps.python.org/pep-0484/#stub-files)
399399
can be used to describe typing information for an external module. Those stub files omit
400400
the implementation of classes and functions they describe, instead they only contain the
401401
structure of the file (listing globals, functions, and classes with their members). The

docs/usage_and_configuration/the_basics.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,9 @@ code in compliance with many other _Black_ formatted projects.
475475

476476
### What on Earth is a `pyproject.toml` file?
477477

478-
[PEP 518](https://www.python.org/dev/peps/pep-0518/) defines `pyproject.toml` as a
479-
configuration file to store build system requirements for Python projects. With the help
480-
of tools like [Poetry](https://python-poetry.org/),
481-
[Flit](https://flit.readthedocs.io/en/latest/), or
478+
[PEP 518](https://peps.python.org/pep-0518/) defines `pyproject.toml` as a configuration
479+
file to store build system requirements for Python projects. With the help of tools like
480+
[Poetry](https://python-poetry.org/), [Flit](https://flit.readthedocs.io/en/latest/), or
482481
[Hatch](https://hatch.pypa.io/latest/) it can fully replace the need for `setup.py` and
483482
`setup.cfg` files.
484483

src/black/strings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def lines_with_leading_tabs_expanded(s: str) -> list[str]:
6464

6565

6666
def fix_multiline_docstring(docstring: str, prefix: str) -> str:
67-
# https://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation
67+
# https://peps.python.org/pep-0257/#handling-docstring-indentation
6868
assert docstring, "INTERNAL ERROR: Multiline docstrings cannot be empty"
6969
lines = lines_with_leading_tabs_expanded(docstring)
7070
# Determine minimum indentation (first line doesn't count):

0 commit comments

Comments
 (0)