Skip to content

Commit 96e12d5

Browse files
minho42terryjreedy
authored andcommitted
Fix typos in docs, comments and test assert messages (python#14872)
1 parent 8e3a738 commit 96e12d5

File tree

21 files changed

+24
-24
lines changed

21 files changed

+24
-24
lines changed

Doc/library/ctypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays
11751175
doesn't *copy* the sub-object, instead it retrieves a wrapper object accessing
11761176
the root-object's underlying buffer.
11771177

1178-
Another example that may behave different from what one would expect is this::
1178+
Another example that may behave differently from what one would expect is this::
11791179

11801180
>>> s = c_char_p()
11811181
>>> s.value = b"abc def ghi"

Lib/asyncio/unix_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ class ThreadedChildWatcher(AbstractChildWatcher):
12431243
It doesn't require subscription on POSIX signal
12441244
but a thread creation is not free.
12451245
1246-
The watcher has O(1) complexity, its perfomance doesn't depend
1246+
The watcher has O(1) complexity, its performance doesn't depend
12471247
on amount of spawn processes.
12481248
"""
12491249

Lib/collections/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def __getnewargs__(self):
440440
'__slots__': (),
441441
'_fields': field_names,
442442
'_field_defaults': field_defaults,
443-
# alternate spelling for backward compatiblity
443+
# alternate spelling for backward compatibility
444444
'_fields_defaults': field_defaults,
445445
'__new__': __new__,
446446
'_make': _make,

Lib/dataclasses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ class C(Base):
11891189
raise TypeError(f'Invalid field: {item!r}')
11901190

11911191
if not isinstance(name, str) or not name.isidentifier():
1192-
raise TypeError(f'Field names must be valid identifers: {name!r}')
1192+
raise TypeError(f'Field names must be valid identifiers: {name!r}')
11931193
if keyword.iskeyword(name):
11941194
raise TypeError(f'Field names must not be keywords: {name!r}')
11951195
if name in seen:

Lib/email/headerregistry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def fold(self, *, policy):
245245
the header name and the ': ' separator.
246246
247247
"""
248-
# At some point we need to put fws here iif it was in the source.
248+
# At some point we need to put fws here if it was in the source.
249249
header = parser.Header([
250250
parser.HeaderLabel([
251251
parser.ValueTerminal(self.name, 'header-name'),

Lib/importlib/_bootstrap_external.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def _write_atomic(path, data, mode=0o666):
261261
# Python 3.7a2 3391 (update GET_AITER #31709)
262262
# Python 3.7a4 3392 (PEP 552: Deterministic pycs #31650)
263263
# Python 3.7b1 3393 (remove STORE_ANNOTATION opcode #32550)
264-
# Python 3.7b5 3394 (restored docstring as the firts stmt in the body;
264+
# Python 3.7b5 3394 (restored docstring as the first stmt in the body;
265265
# this might affected the first line number #32911)
266266
# Python 3.8a1 3400 (move frame block handling to compiler #17611)
267267
# Python 3.8a1 3401 (add END_ASYNC_FOR #33041)

Lib/test/support/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2978,7 +2978,7 @@ def fd_count():
29782978
if sys.platform.startswith(('linux', 'freebsd')):
29792979
try:
29802980
names = os.listdir("/proc/self/fd")
2981-
# Substract one because listdir() opens internally a file
2981+
# Subtract one because listdir() internally opens a file
29822982
# descriptor to list the content of the /proc/self/fd/ directory.
29832983
return len(names) - 1
29842984
except FileNotFoundError:

Lib/test/test_dataclasses.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,11 +3043,11 @@ def test_keyword_field_names(self):
30433043
def test_non_identifier_field_names(self):
30443044
for field in ['()', 'x,y', '*', '2@3', '', 'little johnny tables']:
30453045
with self.subTest(field=field):
3046-
with self.assertRaisesRegex(TypeError, 'must be valid identifers'):
3046+
with self.assertRaisesRegex(TypeError, 'must be valid identifiers'):
30473047
make_dataclass('C', ['a', field])
3048-
with self.assertRaisesRegex(TypeError, 'must be valid identifers'):
3048+
with self.assertRaisesRegex(TypeError, 'must be valid identifiers'):
30493049
make_dataclass('C', [field])
3050-
with self.assertRaisesRegex(TypeError, 'must be valid identifers'):
3050+
with self.assertRaisesRegex(TypeError, 'must be valid identifiers'):
30513051
make_dataclass('C', [field, 'a'])
30523052

30533053
def test_underscore_field_names(self):

Lib/test/test_eintr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_all(self):
2222
print()
2323
print("--- run eintr_tester.py ---", flush=True)
2424
# In verbose mode, the child process inherit stdout and stdout,
25-
# to see output in realtime and reduce the risk of loosing output.
25+
# to see output in realtime and reduce the risk of losing output.
2626
args = [sys.executable, "-E", "-X", "faulthandler", *args]
2727
proc = subprocess.run(args)
2828
print(f"--- eintr_tester.py completed: "

Lib/test/test_fstring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ def __repr__(self):
11611161

11621162
# These next lines contains tabs. Backslash escapes don't
11631163
# work in f-strings.
1164-
# patchcheck doens't like these tabs. So the only way to test
1164+
# patchcheck doesn't like these tabs. So the only way to test
11651165
# this will be to dynamically created and exec the f-strings. But
11661166
# that's such a hassle I'll save it for another day. For now, convert
11671167
# the tabs to spaces just to shut up patchcheck.

0 commit comments

Comments
 (0)