Skip to content

Commit 253c6a0

Browse files
authored
Fix typos in comments and test code (#122846)
1 parent 9375b9c commit 253c6a0

File tree

18 files changed

+28
-28
lines changed

18 files changed

+28
-28
lines changed

Lib/_pylong.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def inner(n, w):
348348
# off-by-1 error too low. So we add 2 instead of 1 if chopping lost
349349
# a fraction > 0.9.
350350

351-
# The "WASI" test platfrom can complain about `len(s)` if it's too
351+
# The "WASI" test platform can complain about `len(s)` if it's too
352352
# large to fit in its idea of "an index-sized integer".
353353
lenS = s.__len__()
354354
log_ub = lenS * _LOG_10_BASE_256
@@ -613,7 +613,7 @@ def int_divmod(a, b):
613613
# ctx.prec = max(n.adjusted() - p256.adjusted(), 0) + GUARD
614614
# hi = +n * +recip # unary `+` chops to ctx.prec digits
615615
#
616-
# we have 3 visible chopped operationa, but there's also a 4th:
616+
# we have 3 visible chopped operations, but there's also a 4th:
617617
# precomputing a truncated `recip` as part of setup.
618618
#
619619
# So the computed product is exactly equal to the true product times
@@ -703,7 +703,7 @@ def int_divmod(a, b):
703703
# Enable for brute-force testing of compute_powers(). This takes about a
704704
# minute, because it tries millions of cases.
705705
if 0:
706-
def consumer(w, limir, need_hi):
706+
def consumer(w, limit, need_hi):
707707
seen = set()
708708
need = set()
709709
def inner(w):
@@ -718,7 +718,7 @@ def inner(w):
718718
inner(lo)
719719
inner(hi)
720720
inner(w)
721-
exp = compute_powers(w, 1, limir, need_hi=need_hi)
721+
exp = compute_powers(w, 1, limit, need_hi=need_hi)
722722
assert exp.keys() == need
723723

724724
from itertools import chain

Lib/_pyrepl/completing_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def build_menu(
9191
# D E F B E
9292
# G C F
9393
#
94-
# "fill" the table with empty words, so we always have the same amout
94+
# "fill" the table with empty words, so we always have the same amount
9595
# of rows for each column
9696
missing = cols*rows - len(wordlist)
9797
wordlist = wordlist + ['']*missing

Lib/_pyrepl/unix_console.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def add_baudrate_if_supported(dictionary: dict[int, int], rate: int) -> None:
109109
try:
110110
poll: type[select.poll] = select.poll
111111
except AttributeError:
112-
# this is exactly the minumum necessary to support what we
112+
# this is exactly the minimum necessary to support what we
113113
# do with poll objects
114114
class MinimalPoll:
115115
def __init__(self):
@@ -613,7 +613,7 @@ def __write_changed_line(self, y, oldline, newline, px_coord):
613613

614614
# reuse the oldline as much as possible, but stop as soon as we
615615
# encounter an ESCAPE, because it might be the start of an escape
616-
# sequene
616+
# sequence
617617
while (
618618
x_coord < minlen
619619
and oldline[x_pos] == newline[x_pos]

Lib/_pyrepl/windows_console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def __write_changed_line(
231231

232232
# reuse the oldline as much as possible, but stop as soon as we
233233
# encounter an ESCAPE, because it might be the start of an escape
234-
# sequene
234+
# sequence
235235
while (
236236
x_coord < minlen
237237
and oldline[x_pos] == newline[x_pos]

Lib/dataclasses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ def _init_fn(fields, std_fields, kw_only_fields, frozen, has_post_init,
656656
if kw_only_fields:
657657
# Add the keyword-only args. Because the * can only be added if
658658
# there's at least one keyword-only arg, there needs to be a test here
659-
# (instead of just concatenting the lists together).
659+
# (instead of just concatenating the lists together).
660660
_init_params += ['*']
661661
_init_params += [_init_param(f) for f in kw_only_fields]
662662
func_builder.add_fn('__init__',

Lib/test/libregrtest/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ def _run_tests(self, selected: TestTuple, tests: TestList | None) -> int:
536536
self._run_tests_mp(runtests, self.num_workers)
537537
else:
538538
# gh-117783: don't immortalize deferred objects when tracking
539-
# refleaks. Only releveant for the free-threaded build.
539+
# refleaks. Only relevant for the free-threaded build.
540540
with suppress_immortalization(runtests.hunt_refleak):
541541
self.run_tests_sequentially(runtests)
542542

Lib/test/libregrtest/single.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def run_single_test(test_name: TestName, runtests: RunTests) -> TestResult:
305305
pgo = runtests.pgo
306306
try:
307307
# gh-117783: don't immortalize deferred objects when tracking
308-
# refleaks. Only releveant for the free-threaded build.
308+
# refleaks. Only relevant for the free-threaded build.
309309
with support.suppress_immortalization(runtests.hunt_refleak):
310310
_runtest(result, runtests)
311311
except:

Lib/test/support/asynchat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TODO: This module was deprecated and removed from CPython 3.12
2-
# Now it is a test-only helper. Any attempts to rewrite exising tests that
2+
# Now it is a test-only helper. Any attempts to rewrite existing tests that
33
# are using this module and remove it completely are appreciated!
44
# See: https://github.com/python/cpython/issues/72719
55

Lib/test/support/asyncore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TODO: This module was deprecated and removed from CPython 3.12
2-
# Now it is a test-only helper. Any attempts to rewrite exising tests that
2+
# Now it is a test-only helper. Any attempts to rewrite existing tests that
33
# are using this module and remove it completely are appreciated!
44
# See: https://github.com/python/cpython/issues/72719
55

Lib/test/support/bytecode_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Label:
7171

7272
def assertInstructionsMatch(self, actual_seq, expected):
7373
# get an InstructionSequence and an expected list, where each
74-
# entry is a label or an instruction tuple. Construct an expcted
74+
# entry is a label or an instruction tuple. Construct an expected
7575
# instruction sequence and compare with the one given.
7676

7777
self.assertIsInstance(expected, list)

0 commit comments

Comments
 (0)