Skip to content

Fix typos in >60 files using codespell & manual review to get rid of false positives #136887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
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
Next Next commit
Revert "Fix various typos and spelling errors found by codespell."
This reverts commit a93e9d6.
  • Loading branch information
corneliusroemer committed Jul 20, 2025
commit 7816b64238cd950a090d1f07da62e3475a121828
4 changes: 2 additions & 2 deletions Doc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ Available make targets are:

* "html", which builds standalone HTML files for offline viewing.

* "htmlview", which reuses the "html" builder, but then opens the main page
* "htmlview", which re-uses the "html" builder, but then opens the main page
in your default web browser.

* "htmllive", which reuses the "html" builder, rebuilds the docs,
* "htmllive", which re-uses the "html" builder, rebuilds the docs,
starts a local server, and automatically reloads the page in your browser
when you make changes to reST files (Unix only).

Expand Down
2 changes: 1 addition & 1 deletion Doc/extending/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ and initialize it by calling :c:func:`PyErr_NewException` in the module's

SpamError = PyErr_NewException("spam.error", NULL, NULL);

Since :c:data:`!SpamError` is a global variable, it will be overwritten every time
Since :c:data:`!SpamError` is a global variable, it will be overwitten every time
the module is reinitialized, when the :c:data:`Py_mod_exec` function is called.

For now, let's avoid the issue: we will block repeated initialization by raising an
Expand Down
4 changes: 2 additions & 2 deletions Doc/howto/functional.rst
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ have the form::
if condition3
...
for exprN in sequenceN
if condition )
if conditionN )

Again, for a list comprehension only the outside brackets are different (square
brackets instead of parentheses).
Expand Down Expand Up @@ -407,7 +407,7 @@ equivalent to the following Python code::
continue # Skip this element
...
for exprN in sequenceN:
if not (condition):
if not (conditionN):
continue # Skip this element

# Output the value of
Expand Down
2 changes: 1 addition & 1 deletion Doc/howto/gdb_helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ enabled::
at Objects/unicodeobject.c:551
#7 0x0000000000440d94 in PyUnicodeUCS2_FromString (u=0x5c2b8d "__lltrace__") at Objects/unicodeobject.c:569
#8 0x0000000000584abd in PyDict_GetItemString (v=
{'Yuck': <type at remote 0xad4730>, '__builtins__': <module at remote 0x7ffff7fd5ee8>, '__file__': 'Lib/test/crashes/nasty_eq_vs_dict.py', '__package__': None, 'y': <Yuck(i=0) at remote 0xaacd80>, 'dict': {0: 0, 1: 1, 2: 2, 3: 3}, '__cached__': None, '__name__': '__main__', 'z': <Yuck(i=0) at remote 0xaace60>, '__doc__': None}, key=
{'Yuck': <type at remote 0xad4730>, '__builtins__': <module at remote 0x7ffff7fd5ee8>, '__file__': 'Lib/test/crashers/nasty_eq_vs_dict.py', '__package__': None, 'y': <Yuck(i=0) at remote 0xaacd80>, 'dict': {0: 0, 1: 1, 2: 2, 3: 3}, '__cached__': None, '__name__': '__main__', 'z': <Yuck(i=0) at remote 0xaace60>, '__doc__': None}, key=
0x5c2b8d "__lltrace__") at Objects/dictobject.c:2171

Notice how the dictionary argument to ``PyDict_GetItemString`` is displayed
Expand Down
4 changes: 2 additions & 2 deletions Doc/includes/email-read-alternative.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def magic_html_parser(html_text, partfiles):
print()
print(''.join(simplest.get_content().splitlines(keepends=True)[:3]))

and = input("View full message?")
if and.lower()[0] == 'n':
ans = input("View full message?")
if ans.lower()[0] == 'n':
sys.exit()

# We can extract the richest alternative in order to display it:
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/bz2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ Using :func:`compress` and :func:`decompress` to demonstrate round-trip compress
>>> import bz2
>>> data = b"""\
... Donec rhoncus quis sapien sit amet molestie. Fusce scelerisque vel augue
... nec ullamcorper. Name rutrum pretium placerat. Aliquam vel tristique lorem,
... nec ullamcorper. Nam rutrum pretium placerat. Aliquam vel tristique lorem,
... sit amet cursus ante. In interdum laoreet mi, sit amet ultrices purus
... pulvinar a. Name gravida euismod magna, non various justo tincidunt feugiat.
... pulvinar a. Nam gravida euismod magna, non varius justo tincidunt feugiat.
... Aliquam pharetra lacus non risus vehicula rutrum. Maecenas aliquam leo
... felis. Pellentesque semper nunc sit amet nibh ullamcorper, ac elementum
... dolor luctus. Curabitur lacinia mi ornare consectetur vestibulum."""
Expand Down Expand Up @@ -362,9 +362,9 @@ Writing and reading a bzip2-compressed file in binary mode:
>>> import bz2
>>> data = b"""\
... Donec rhoncus quis sapien sit amet molestie. Fusce scelerisque vel augue
... nec ullamcorper. Name rutrum pretium placerat. Aliquam vel tristique lorem,
... nec ullamcorper. Nam rutrum pretium placerat. Aliquam vel tristique lorem,
... sit amet cursus ante. In interdum laoreet mi, sit amet ultrices purus
... pulvinar a. Name gravida euismod magna, non various justo tincidunt feugiat.
... pulvinar a. Nam gravida euismod magna, non varius justo tincidunt feugiat.
... Aliquam pharetra lacus non risus vehicula rutrum. Maecenas aliquam leo
... felis. Pellentesque semper nunc sit amet nibh ullamcorper, ac elementum
... dolor luctus. Curabitur lacinia mi ornare consectetur vestibulum."""
Expand Down
18 changes: 9 additions & 9 deletions Doc/library/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ or subtracting from an empty counter.
Returns a new deque object initialized left-to-right (using :meth:`append`) with
data from *iterable*. If *iterable* is not specified, the new deque is empty.

Dequeues are a generalization of stacks and queues (the name is pronounced "deck"
and is short for "double-ended queue"). Dequeues support thread-safe, memory
Deques are a generalization of stacks and queues (the name is pronounced "deck"
and is short for "double-ended queue"). Deques support thread-safe, memory
efficient appends and pops from either side of the deque with approximately the
same *O*\ (1) performance in either direction.

Expand All @@ -466,11 +466,11 @@ or subtracting from an empty counter.
position of the underlying data representation.


If *maxlen* is not specified or is ``None``, dequeues may grow to an
If *maxlen* is not specified or is ``None``, deques may grow to an
arbitrary length. Otherwise, the deque is bounded to the specified maximum
length. Once a bounded length deque is full, when new items are added, a
corresponding number of items are discarded from the opposite end. Bounded
length dequeues provide functionality similar to the ``tail`` filter in
length deques provide functionality similar to the ``tail`` filter in
Unix. They are also useful for tracking transactions and other pools of data
where only the most recent activity is of interest.

Expand Down Expand Up @@ -582,13 +582,13 @@ or subtracting from an empty counter.
.. versionadded:: 3.1


In addition to the above, dequeues support iteration, pickling, ``len(d)``,
In addition to the above, deques support iteration, pickling, ``len(d)``,
``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing with
the :keyword:`in` operator, and subscript references such as ``d[0]`` to access
the first element. Indexed access is *O*\ (1) at both ends but slows to *O*\ (*n*) in
the middle. For fast random access, use lists instead.

Starting in version 3.5, dequeues support ``__add__()``, ``__mul__()``,
Starting in version 3.5, deques support ``__add__()``, ``__mul__()``,
and ``__imul__()``.

Example:
Expand Down Expand Up @@ -650,17 +650,17 @@ Example:
:class:`deque` Recipes
^^^^^^^^^^^^^^^^^^^^^^

This section shows various approaches to working with dequeues.
This section shows various approaches to working with deques.

Bounded length dequeues provide functionality similar to the ``tail`` filter
Bounded length deques provide functionality similar to the ``tail`` filter
in Unix::

def tail(filename, n=10):
'Return the last n lines of a file'
with open(filename) as f:
return deque(f, n)

Another approach to using dequeues is to maintain a sequence of recently
Another approach to using deques is to maintain a sequence of recently
added elements by appending to the right and popping to the left::

def moving_average(iterable, n=3):
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2515,8 +2515,8 @@ requires, and these work on all platforms with a standard C implementation.
+-----------+--------------------------------+------------------------+-------+
| ``%B`` | Month as locale's full name. || January, February, | \(1) |
| | | ..., December (en_US);| |
| | || January, February, ..., | |
| | | December (de_DE) | |
| | || Januar, Februar, ..., | |
| | | Dezember (de_DE) | |
+-----------+--------------------------------+------------------------+-------+
| ``%m`` | Month as a zero-padded | 01, 02, ..., 12 | \(9) |
| | decimal number. | | |
Expand Down
12 changes: 6 additions & 6 deletions Doc/library/difflib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
>>> print(''.join(diff), end="")
- one
? ^
+ or
+ ore
? ^
- two
- three
Expand All @@ -273,7 +273,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
two
three
>>> print(''.join(restore(diff, 2)), end="")
or
ore
tree
emu

Expand Down Expand Up @@ -420,12 +420,12 @@ The :class:`SequenceMatcher` class has this constructor:
is not changed.


.. method:: find_longest_match(also=0, ahi=None, blo=0, bhi=None)
.. method:: find_longest_match(alo=0, ahi=None, blo=0, bhi=None)

Find longest matching block in ``a[also:ahi]`` and ``b[blo:bhi]``.
Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``.

If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns
``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``also
``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo
<= i <= i+k <= ahi`` and ``blo <= j <= j+k <= bhi``. For all ``(i', j',
k')`` meeting those conditions, the additional conditions ``k >= k'``, ``i
<= i'``, and if ``i == i'``, ``j <= j'`` are also met. In other words, of
Expand Down Expand Up @@ -453,7 +453,7 @@ The :class:`SequenceMatcher` class has this constructor:
>>> s.find_longest_match(0, 5, 0, 9)
Match(a=1, b=0, size=4)

If no blocks match, this returns ``(also, blo, 0)``.
If no blocks match, this returns ``(alo, blo, 0)``.

This method returns a :term:`named tuple` ``Match(a, b, size)``.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ the `Python Package Index <https://pypi.org>`_.
archiving.rst
fileformats.rst
crypto.rst
allows.rst
allos.rst
cmdlinelibs.rst
concurrency.rst
ipc.rst
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/pickle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,
The memo is the data structure that remembers which objects the
pickler has already seen, so that shared or recursive objects
are pickled by reference and not by value. This method is
useful when reusing picklers.
useful when re-using picklers.


.. class:: Unpickler(file, *, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/re.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ in each word of a sentence except for the first and last characters::
>>> re.sub(r"(\w)(\w+)(\w)", repl, text)
'Poefsrosr Aealmlobdk, pslaee reorpt your abnseces plmrptoy.'
>>> re.sub(r"(\w)(\w+)(\w)", repl, text)
'Pofsroser Aodlambelk, plasee report your asnebces potlmrpy.'
'Pofsroser Aodlambelk, plasee reoprt yuor asnebces potlmrpy.'


Finding all Adverbs
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/shelve.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Restrictions
which can cause hard crashes when trying to read from the database.

* :meth:`Shelf.reorganize` may not be available for all database packages and
may temporarily increase resource usage (especially disk space) when called.
may temporarely increase resource usage (especially disk space) when called.
Additionally, it will never run automatically and instead needs to be called
explicitly.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2285,7 +2285,7 @@ something like the following::
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:MyState
Locality Name (eg, city) []:Some City
Organization Name (eg, company) [Internet Widgets Pty Ltd]:My Organization, Inc.
Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Organization, Inc.
Organizational Unit Name (eg, section) []:My Group
Common Name (eg, YOUR name) []:myserver.mygroup.myorganization.com
Email Address []:ops@myserver.mygroup.myorganization.com
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/subprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1359,12 +1359,12 @@ Replacing shell pipeline

.. code-block:: bash

output=$(dmesg | grep had)
output=$(dmesg | grep hda)

becomes::

p1 = Popen(["dmesg"], stdout=PIPE)
p2 = Popen(["grep", "had"], stdin=p1.stdout, stdout=PIPE)
p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.
output = p2.communicate()[0]

Expand All @@ -1376,11 +1376,11 @@ be used directly:

.. code-block:: bash

output=$(dmesg | grep had)
output=$(dmesg | grep hda)

becomes::

output = check_output("dmesg | grep had", shell=True)
output = check_output("dmesg | grep hda", shell=True)


Replacing :func:`os.system`
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ the *new_callable* argument to :func:`patch`.
:attr:`return_value` attribute.

* *unsafe*: By default, accessing any attribute whose name starts with
*assert*, *assret*, *assert*, *aseert* or *assrt* will raise an
*assert*, *assret*, *asert*, *aseert* or *assrt* will raise an
:exc:`AttributeError`. Passing ``unsafe=True`` will allow access to
these attributes.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/unittest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ advantages to placing the test code in a separate module, such as

.. _legacy-unit-tests:

Reusing old test code
Re-using old test code
----------------------

Some users will find that they have existing test code that they would like to
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/urllib.parse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The module has been designed to match the internet RFC on Relative Uniform
Resource Locators. It supports the following URL schemes: ``file``, ``ftp``,
``gopher``, ``hdl``, ``http``, ``https``, ``imap``, ``itms-services``, ``mailto``, ``mms``,
``news``, ``nntp``, ``prospero``, ``rsync``, ``rtsp``, ``rtsps``, ``rtspu``,
``sftp``, ``https``, ``sip``, ``sips``, ``snews``, ``svn``, ``svn+ssh``,
``sftp``, ``shttp``, ``sip``, ``sips``, ``snews``, ``svn``, ``svn+ssh``,
``telnet``, ``wais``, ``ws``, ``wss``.

.. impl-detail::
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/venv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ containing a copy or symlink of the Python executable
(as appropriate for the platform or arguments used at environment creation time).
It also creates a :file:`lib/pythonX.Y/site-packages` subdirectory
(on Windows, this is :file:`Lib\site-packages`).
If an existing directory is specified, it will be reused.
If an existing directory is specified, it will be re-used.

.. versionchanged:: 3.5
The use of ``venv`` is now recommended for creating virtual environments.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/weakref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ exposed by the :mod:`weakref` module for the benefit of advanced uses.
Not all objects can be weakly referenced. Objects which support weak references
include class instances, functions written in Python (but not in C), instance methods,
sets, frozensets, some :term:`file objects <file object>`, :term:`generators <generator>`,
type objects, sockets, arrays, dequeues, regular expression pattern objects, and code
type objects, sockets, arrays, deques, regular expression pattern objects, and code
objects.

.. versionchanged:: 3.2
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/xml.sax.handler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ events in the input document:
string and the *attrs* parameter holds an object of the
:class:`~xml.sax.xmlreader.Attributes`
interface (see :ref:`attributes-objects`) containing the attributes of
the element. The object passed as *attrs* may be reused by the parser; holding
the element. The object passed as *attrs* may be re-used by the parser; holding
on to a reference to it is not a reliable way to keep a copy of the attributes.
To keep a copy of the attributes, use the :meth:`copy` method of the *attrs*
object.
Expand All @@ -275,7 +275,7 @@ events in the input document:
:ref:`attributes-ns-objects`)
containing the attributes of the element. If no namespace is associated with
the element, the *uri* component of *name* will be ``None``. The object passed
as *attrs* may be reused by the parser; holding on to a reference to it is not
as *attrs* may be re-used by the parser; holding on to a reference to it is not
a reliable way to keep a copy of the attributes. To keep a copy of the
attributes, use the :meth:`copy` method of the *attrs* object.

Expand Down
6 changes: 3 additions & 3 deletions Doc/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ through all other variables that refer to it.::
>>> rgba = rgb
>>> id(rgb) == id(rgba) # they reference the same object
True
>>> rgba.append("Alpha")
>>> rgba.append("Alph")
>>> rgb
["Red", "Green", "Blue", "Alpha"]
["Red", "Green", "Blue", "Alph"]

All slice operations return a new list containing the requested elements. This
means that the following slice returns a
Expand All @@ -449,7 +449,7 @@ means that the following slice returns a
>>> correct_rgba
["Red", "Green", "Blue", "Alpha"]
>>> rgba
["Red", "Green", "Blue", "Alpha"]
["Red", "Green", "Blue", "Alph"]

Assignment to slices is also possible, and this can even change the size of the
list or clear it entirely::
Expand Down
2 changes: 1 addition & 1 deletion Doc/using/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ free-threaded binaries at this time.

To specify the install option at the command line, use
``Include_freethreaded=1``. See :ref:`install-layout-option` for instructions on
preemptively downloading the additional binaries for offline install. The
pre-emptively downloading the additional binaries for offline install. The
options to include debug symbols and binaries also apply to the free-threaded
builds.

Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/2.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ complete list of changes, or look through the CVS logs for all the details.
comparable. (Contributed by Raymond Hettinger.)

* The :mod:`weakref` module now supports a wider variety of objects including
Python functions, class instances, sets, frozensets, dequeues, arrays, files,
Python functions, class instances, sets, frozensets, deques, arrays, files,
sockets, and regular expression pattern objects. (Contributed by Raymond
Hettinger.)

Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/2.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3093,7 +3093,7 @@ Changes to Python's build process and to the C API include:
(Contributed by Collin Winter; :issue:`1530959`.)

* Several basic data types, such as integers and strings, maintain
internal free lists of objects that can be reused. The data
internal free lists of objects that can be re-used. The data
structures for these free lists now follow a naming convention: the
variable is always named ``free_list``, the counter is always named
``numfree``, and a macro ``Py<typename>_MAXFREELIST`` is
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ Operators And Special Methods

* The function attributes named :attr:`!func_X` have been renamed to
use the :attr:`!__X__` form, freeing up these names in the function
attribute namespace for user-defined attributes. To with,
attribute namespace for user-defined attributes. To wit,
:attr:`!func_closure`, :attr:`!func_code`, :attr:`!func_defaults`,
:attr:`!func_dict`, :attr:`!func_doc`, :attr:`!func_globals`,
:attr:`!func_name` were renamed to :attr:`~function.__closure__`,
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy