Skip to content

Commit ef6d475

Browse files
authored
Fix typos in docs and comments (#109619)
1 parent 32ffe58 commit ef6d475

File tree

14 files changed

+15
-15
lines changed

14 files changed

+15
-15
lines changed

Doc/c-api/exceptions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ Exception Objects
786786
787787
Implement part of the interpreter's implementation of :keyword:`!except*`.
788788
*orig* is the original exception that was caught, and *excs* is the list of
789-
the exceptions that need to be raised. This list contains the the unhandled
789+
the exceptions that need to be raised. This list contains the unhandled
790790
part of *orig*, if any, as well as the exceptions that were raised from the
791791
:keyword:`!except*` clauses (so they have a different traceback from *orig*) and
792792
those that were reraised (and have the same traceback as *orig*).

Doc/library/typing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ These can be used as types in annotations. They all support subscription using
13011301
completely disables typechecking for a function or class.
13021302

13031303
The responsibility of how to interpret the metadata
1304-
lies with the the tool or library encountering an
1304+
lies with the tool or library encountering an
13051305
``Annotated`` annotation. A tool or library encountering an ``Annotated`` type
13061306
can scan through the metadata elements to determine if they are of interest
13071307
(e.g., using :func:`isinstance`).

Doc/library/unittest.mock.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ object::
11301130

11311131
.. method:: wait_until_any_call_with(*args, **kwargs)
11321132

1133-
Waits until the the mock is called with the specified arguments.
1133+
Waits until the mock is called with the specified arguments.
11341134

11351135
If a timeout was passed at the creation of the mock
11361136
the function raises an :exc:`AssertionError` if the call is not performed in time.

Doc/whatsnew/3.12.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ create an interpreter with its own GIL::
308308
if (PyStatus_Exception(status)) {
309309
return -1;
310310
}
311-
/* The new interpeter is now active in the current thread. */
311+
/* The new interpreter is now active in the current thread. */
312312

313313
For further examples how to use the C-API for sub-interpreters with a
314314
per-interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`.

Doc/whatsnew/3.13.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ copy
119119
----
120120

121121
* Add :func:`copy.replace` function which allows to create a modified copy of
122-
an object, which is especially usefule for immutable objects.
122+
an object, which is especially useful for immutable objects.
123123
It supports named tuples created with the factory function
124124
:func:`collections.namedtuple`, :class:`~dataclasses.dataclass` instances,
125125
various :mod:`datetime` objects, :class:`~inspect.Signature` objects,
@@ -208,7 +208,7 @@ tkinter
208208
traceback
209209
---------
210210

211-
* Add *show_group* paramter to :func:`traceback.TracebackException.format_exception_only`
211+
* Add *show_group* parameter to :func:`traceback.TracebackException.format_exception_only`
212212
to format the nested exceptions of a :exc:`BaseExceptionGroup` instance, recursively.
213213
(Contributed by Irit Katriel in :gh:`105292`.)
214214

Doc/whatsnew/3.5.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ and improves their substitutability for lists.
921921
Docstrings produced by :func:`~collections.namedtuple` can now be updated::
922922

923923
Point = namedtuple('Point', ['x', 'y'])
924-
Point.__doc__ += ': Cartesian coodinate'
924+
Point.__doc__ += ': Cartesian coordinate'
925925
Point.x.__doc__ = 'abscissa'
926926
Point.y.__doc__ = 'ordinate'
927927

Lib/concurrent/futures/process.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def terminate_broken(self, cause):
495495
# set_exception() fails if the future is cancelled: ignore it.
496496
# Trying to check if the future is cancelled before calling
497497
# set_exception() would leave a race condition if the future is
498-
# cancelled betwen the check and set_exception().
498+
# cancelled between the check and set_exception().
499499
pass
500500
# Delete references to object. See issue16284
501501
del work_item

Lib/test/test_descr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,7 @@ def __getattr__(self, attr):
19891989
ns = {}
19901990
exec(code, ns)
19911991
number_attrs = ns["number_attrs"]
1992-
# Warm up the the function for quickening (PEP 659)
1992+
# Warm up the function for quickening (PEP 659)
19931993
for _ in range(30):
19941994
self.assertEqual(number_attrs(Numbers()), list(range(280)))
19951995

Lib/test/test_dynamic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def __missing__(self, key):
145145
code = "lambda: " + "+".join(f"_number_{i}" for i in range(variables))
146146
sum_func = eval(code, MyGlobals())
147147
expected = sum(range(variables))
148-
# Warm up the the function for quickening (PEP 659)
148+
# Warm up the function for quickening (PEP 659)
149149
for _ in range(30):
150150
self.assertEqual(sum_func(), expected)
151151

Lib/test/test_frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def f():
322322
sneaky_frame_object = None
323323
gc.enable()
324324
next(g)
325-
# g.gi_frame should be the the frame object from the callback (the
325+
# g.gi_frame should be the frame object from the callback (the
326326
# one that was *requested* second, but *created* first):
327327
self.assertIs(g.gi_frame, sneaky_frame_object)
328328
finally:

Lib/test/test_unpack.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def test_extended_oparg_not_ignored(self):
162162
ns = {}
163163
exec(code, ns)
164164
unpack_400 = ns["unpack_400"]
165-
# Warm up the the function for quickening (PEP 659)
165+
# Warm up the function for quickening (PEP 659)
166166
for _ in range(30):
167167
y = unpack_400(range(400))
168168
self.assertEqual(y, 399)
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Add :c:func:`PyLong_AsInt` function: similar to :c:func:`PyLong_AsLong`, but
22
store the result in a C :c:expr:`int` instead of a C :c:expr:`long`.
3-
Previously, it was known as the the private function :c:func:`!_PyLong_AsInt`
3+
Previously, it was known as the private function :c:func:`!_PyLong_AsInt`
44
(with an underscore prefix). Patch by Victor Stinner.

Objects/object_layout.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ and the ``dict`` field points to the dictionary.
3636

3737
## 3.12 pre-header
3838

39-
In 3.12 the the pointer to the list of weak references is added to the
39+
In 3.12 the pointer to the list of weak references is added to the
4040
pre-header. In order to make space for it, the ``dict`` and ``values``
4141
pointers are combined into a single tagged pointer:
4242

Tools/cases_generator/generate_cases.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def effect_str(effects: list[StackEffect]) -> str:
168168
popped, pushed = stacking.get_stack_effect_info_for_macro(instr)
169169
case parsing.Pseudo():
170170
instr = self.pseudo_instrs[thing.name]
171-
# Calculate stack effect, and check that it's the the same
171+
# Calculate stack effect, and check that it's the same
172172
# for all targets.
173173
for target in self.pseudos[thing.name].targets:
174174
target_instr = self.instrs.get(target)

0 commit comments

Comments
 (0)