Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1ed2e69

Browse files
committed
Issue #22186: Fix typos in Lib/.
Patch by Févry Thibault.
2 parents 8c06ac5 + f23530f commit 1ed2e69

14 files changed

Lines changed: 16 additions & 16 deletions

File tree

Lib/heapq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def merge(*iterables, key=None, reverse=False):
429429
# value seen being in the 100 most extreme values is 100/101.
430430
# * If the value is a new extreme value, the cost of inserting it into the
431431
# heap is 1 + log(k, 2).
432-
# * The probabilty times the cost gives:
432+
# * The probability times the cost gives:
433433
# (k/i) * (1 + log(k, 2))
434434
# * Summing across the remaining n-k elements gives:
435435
# sum((k/i) * (1 + log(k, 2)) for i in range(k+1, n+1))

Lib/idlelib/idle_test/htest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _wrapper(parent): # htest #
171171
"<nothing> is invalid.\n"
172172
"No modifier key is invalid.\n"
173173
"Shift key with [a-z],[0-9], function key, move key, tab, space"
174-
"is invalid.\nNo validitity checking if advanced key binding "
174+
"is invalid.\nNo validity checking if advanced key binding "
175175
"entry is used."
176176
}
177177

Lib/idlelib/idle_test/mock_tk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def _decode(self, index, endflag=0):
116116
"""Return a (line, char) tuple of int indexes into self.data.
117117
118118
This implements .index without converting the result back to a string.
119-
The result is contrained by the number of lines and linelengths of
119+
The result is constrained by the number of lines and linelengths of
120120
self.data. For many indexes, the result is initially (1, 0).
121121
122122
The input index may have any of several possible forms:

Lib/idlelib/idle_test/test_autoexpand.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_before_only(self):
7878
equal(previous(), 'a')
7979

8080
def test_after_only(self):
81-
# Also add punctuation 'noise' that shoud be ignored.
81+
# Also add punctuation 'noise' that should be ignored.
8282
text = self.text
8383
previous = self.auto_expand.getprevword
8484
expand = self.auto_expand.expand_word_event

Lib/inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
# Create constants for the compiler flags in Include/code.h
5252
# We try to get them from dis to avoid duplication, but fall
53-
# back to hardcoding so the dependency is optional
53+
# back to hard-coding so the dependency is optional
5454
try:
5555
from dis import COMPILER_FLAG_NAMES as _flag_names
5656
except ImportError:

Lib/ipaddress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def _prefix_from_ip_int(cls, ip_int):
479479
"""Return prefix length from the bitwise netmask.
480480
481481
Args:
482-
ip_int: An integer, the netmask in axpanded bitwise format
482+
ip_int: An integer, the netmask in expanded bitwise format
483483
484484
Returns:
485485
An integer, the prefix length.

Lib/lib2to3/tests/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_3x_style_invalid_4(self):
9090
self.invalid_syntax("raise E from")
9191

9292

93-
# Adaptated from Python 3's Lib/test/test_grammar.py:GrammarTests.testFuncdef
93+
# Adapted from Python 3's Lib/test/test_grammar.py:GrammarTests.testFuncdef
9494
class TestFunctionAnnotations(GrammarTest):
9595
def test_1(self):
9696
self.validate("""def f(x) -> list: pass""")

Lib/pdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def user_exception(self, frame, exc_info):
301301
# An 'Internal StopIteration' exception is an exception debug event
302302
# issued by the interpreter when handling a subgenerator run with
303303
# 'yield from' or a generator controled by a for loop. No exception has
304-
# actually occured in this case. The debugger uses this debug event to
304+
# actually occurred in this case. The debugger uses this debug event to
305305
# stop when the debuggee is returning from such generators.
306306
prefix = 'Internal ' if (not exc_traceback
307307
and exc_type is StopIteration) else ''

Lib/poplib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class error_proto(Exception): pass
4141
CRLF = CR+LF
4242

4343
# maximal line length when calling readline(). This is to prevent
44-
# reading arbitrary lenght lines. RFC 1939 limits POP3 line length to
44+
# reading arbitrary length lines. RFC 1939 limits POP3 line length to
4545
# 512 characters, including CRLF. We have selected 2048 just to be on
4646
# the safe side.
4747
_MAXLINE = 2048

Lib/socketserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def handle_request(self):
288288
deadline = time() + timeout
289289

290290
# Wait until a request arrives or the timeout expires - the loop is
291-
# necessary to accomodate early wakeups due to EINTR.
291+
# necessary to accommodate early wakeups due to EINTR.
292292
with _ServerSelector() as selector:
293293
selector.register(self, selectors.EVENT_READ)
294294

0 commit comments

Comments
 (0)