bpo-36766: Typos in docs and code comments (GH-13116) · python/cpython@9646630 (original) (raw)

22 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -188,7 +188,7 @@ to be using :class:`BytesGenerator`, and not :class:`Generator`.
188 188 (This is required because strings cannot represent non-ASCII bytes.)
189 189 Convert any bytes with the high bit set as needed using an
190 190 ASCII-compatible :mailheader:`Content-Transfer-Encoding`. That is,
191 - transform parts with non-ASCII :mailheader:`Cotnent-Transfer-Encoding`
191 + transform parts with non-ASCII :mailheader:`Content-Transfer-Encoding`
192 192 (:mailheader:`Content-Transfer-Encoding: 8bit`) to an ASCII compatible
193 193 :mailheader:`Content-Transfer-Encoding`, and encode RFC-invalid non-ASCII
194 194 bytes in headers using the MIME ``unknown-8bit`` character set, thus
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ modules.
44 44
45 45 .. versionadded:: 3.7
46 46 Descriptors for nested definitions. They are accessed through the
47 - new children attibute. Each has a new parent attribute.
47 + new children attribute. Each has a new parent attribute.
48 48
49 49 The descriptors returned by these functions are instances of
50 50 Function and Class classes. Users are not expected to create instances
Original file line number Diff line number Diff line change
@@ -2225,7 +2225,7 @@ def detach(self):
2225 2225 'General': '''
2226 2226 General:
2227 2227
2228 -AutoComplete: Popupwait is milleseconds to wait after key char, without
2228 +AutoComplete: Popupwait is milliseconds to wait after key char, without
2229 2229 cursor movement, before popping up completion box. Key char is '.' after
2230 2230 identifier or a '/' (or '\\' on Windows) within a string.
2231 2231
Original file line number Diff line number Diff line change
@@ -721,7 +721,7 @@

Developing tkinter applications<a class="headerlink" href="#developing-tkint

721 721 <span class="pre">root</span> <span class="pre">=</span> <span class="pre">tk.Tk()</span></code> in standard Python and nothing appears. Enter the same
722 722 in IDLE and a tk window appears. In standard Python, one must also enter
723 723 <code class="docutils literal notranslate"><span class="pre">root.update()</span></code> to see the window. IDLE does the equivalent in the
724 -background, about 20 times a second, which is about every 50 milleseconds.
724 +background, about 20 times a second, which is about every 50 milliseconds.
725 725 Next enter <code class="docutils literal notranslate"><span class="pre">b</span> <span class="pre">=</span> <span class="pre">tk.Button(root,</span> <span class="pre">text='button');</span> <span class="pre">b.pack()</span></code>. Again,
726 726 nothing visibly changes in standard Python until one enters <code class="docutils literal notranslate"><span class="pre">root.update()</span></code>.</p>
727 727 <p>Most tkinter programs run <code class="docutils literal notranslate"><span class="pre">root.mainloop()</span></code>, which usually does not
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
2 2 Contents are subject to revision at any time, without notice.
3 3
4 4
5 -Help => About IDLE: diplay About Idle dialog
5 +Help => About IDLE: display About Idle dialog
6 6
7 7 <to be moved here from help_about.py>
8 8
Original file line number Diff line number Diff line change
@@ -521,7 +521,7 @@ def test_get_current_keyset(self):
521 521 def test_get_keyset(self):
522 522 conf = self.mock_config()
523 523
524 -# Conflic with key set, should be disable to ''
524 +# Conflict with key set, should be disable to ''
525 525 conf.defaultCfg['extensions'].add_section('Foobar')
526 526 conf.defaultCfg['extensions'].add_section('Foobar_cfgBindings')
527 527 conf.defaultCfg['extensions'].set('Foobar', 'enable', 'True')
Original file line number Diff line number Diff line change
@@ -321,7 +321,7 @@ def untokenize(iterable):
321 321 Round-trip invariant for full input:
322 322 Untokenized source will match input source exactly
323 323
324 - Round-trip invariant for limited intput:
324 + Round-trip invariant for limited input:
325 325 # Output text will tokenize the back to the input
326 326 t1 = [tok[:2] for tok in generate_tokens(f.readline)]
327 327 newcode = untokenize(t1)
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ def detach(self):
59 59
60 60
61 61 class _ResourceSharer(object):
62 -'''Manager for resouces using background thread.'''
62 +'''Manager for resources using background thread.'''
63 63 def __init__(self):
64 64 self._key = 0
65 65 self._cache = {}
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@
34 34 # Internals
35 35 #
36 36
37 -# EBADF - guard agains macOS `stat` throwing EBADF
37 +# EBADF - guard against macOS `stat` throwing EBADF
38 38 _IGNORED_ERROS = (ENOENT, ENOTDIR, EBADF)
39 39
40 40 _IGNORED_WINERRORS = (
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@
72 72 # type information
73 73 # 0.4.0 - added win32_ver() and modified the platform() output for WinXX
74 74 # 0.3.4 - fixed a bug in _follow_symlinks()
75 -# 0.3.3 - fixed popen() and "file" command invokation bugs
75 +# 0.3.3 - fixed popen() and "file" command invocation bugs
76 76 # 0.3.2 - added architecture() API and support for it in platform()
77 77 # 0.3.1 - fixed syscmd_ver() RE to support Windows NT
78 78 # 0.3.0 - added system alias support
Original file line number Diff line number Diff line change
@@ -509,7 +509,7 @@ def func_std_string(func_name): # match what old profile produced
509 509 return "%s:%d(%s)" % func_name
510 510
511 511 #**************************************************************************
512 -# The following functions combine statists for pairs functions.
512 +# The following functions combine statistics for pairs functions.
513 513 # The bulk of the processing involves correctly handling "call" lists,
514 514 # such as callers and callees.
515 515 #**************************************************************************
Original file line number Diff line number Diff line change
@@ -3483,7 +3483,7 @@ def utcoffset(self, t):
3483 3483 self.assertEqual(got, expected)
3484 3484
3485 3485 # However, if they're different members, uctoffset is not ignored.
3486 -# Note that a time can't actually have an operand-depedent offset,
3486 +# Note that a time can't actually have an operand-dependent offset,
3487 3487 # though (and time.utcoffset() passes None to tzinfo.utcoffset()),
3488 3488 # so skip this test for time.
3489 3489 if cls is not time:
Original file line number Diff line number Diff line change
@@ -2222,7 +2222,7 @@ def remove_frames(pickled, keep_frame=None):
2222 2222
2223 2223 frame_size = self.FRAME_SIZE_TARGET
2224 2224 num_frames = 20
2225 -# Large byte objects (dict values) intermitted with small objects
2225 +# Large byte objects (dict values) intermittent with small objects
2226 2226 # (dict keys)
2227 2227 obj = {i: bytes([i]) * frame_size for i in range(num_frames)}
2228 2228
Original file line number Diff line number Diff line change
@@ -1006,7 +1006,7 @@ def temp_dir(path=None, quiet=False):
1006 1006 yield path
1007 1007 finally:
1008 1008 # In case the process forks, let only the parent remove the
1009 -# directory. The child has a diffent process id. (bpo-30028)
1009 +# directory. The child has a different process id. (bpo-30028)
1010 1010 if dir_created and pid == os.getpid():
1011 1011 rmtree(path)
1012 1012
Original file line number Diff line number Diff line change
@@ -1458,7 +1458,7 @@ class C:
1458 1458 }
1459 1459 )
1460 1460
1461 -# Make sure that the returned dicts are actuall OrderedDicts.
1461 +# Make sure that the returned dicts are actually OrderedDicts.
1462 1462 self.assertIs(type(d), OrderedDict)
1463 1463 self.assertIs(type(d['y'][1]), OrderedDict)
1464 1464
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ class LazyLoaderTests(unittest.TestCase):
56 56
57 57 def test_init(self):
58 58 with self.assertRaises(TypeError):
59 -# Classes that dono't define exec_module() trigger TypeError.
59 +# Classes that don't define exec_module() trigger TypeError.
60 60 util.LazyLoader(object)
61 61
62 62 def new_module(self, source_code=None):
Original file line number Diff line number Diff line change
@@ -719,7 +719,7 @@ def test_choices_algorithms(self):
719 719 c = self.gen.choices(range(n), cum_weights=range(1, n+1), k=10000)
720 720 self.assertEqual(a, c)
721 721
722 -# Amerian Roulette
722 +# American Roulette
723 723 population = ['Red', 'Black', 'Green']
724 724 weights = [18, 18, 2]
725 725 cum_weights = [18, 36, 38]
Original file line number Diff line number Diff line change
@@ -4332,7 +4332,7 @@ def test_pha_optional_nocert(self):
4332 4332 self.assertEqual(s.recv(1024), b'FALSE\n')
4333 4333 s.write(b'PHA')
4334 4334 self.assertEqual(s.recv(1024), b'OK\n')
4335 -# optional doens't fail when client does not have a cert
4335 +# optional doesn't fail when client does not have a cert
4336 4336 s.write(b'HASCERT')
4337 4337 self.assertEqual(s.recv(1024), b'FALSE\n')
4338 4338
Original file line number Diff line number Diff line change
@@ -211,7 +211,7 @@ def foo3(bar: 'func'=lambda x: x) -> {1: 2}:
211 211 self.assertIn('doc3', msgids)
212 212
213 213 def test_classdocstring_early_colon(self):
214 -""" Test docstring extraction for a class with colons occuring within
214 +""" Test docstring extraction for a class with colons occurring within
215 215 the parentheses.
216 216 """
217 217 msgids = self.extract_docstrings_from_str(dedent('''\
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ def maybe(*choices): return group(*choices) + '?'
82 82 # Return the empty string, plus all of the valid string prefixes.
83 83 def _all_string_prefixes():
84 84 # The valid string prefixes. Only contain the lower case versions,
85 -# and don't contain any permuations (include 'fr', but not
85 +# and don't contain any permutations (include 'fr', but not
86 86 # 'rf'). The various permutations will be generated.
87 87 _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']
88 88 # if we add binary f-strings, add: ['fb', 'fbr']
Original file line number Diff line number Diff line change
@@ -1568,7 +1568,7 @@ def degrees(self, fullcircle=360.0):
1568 1568 fullcircle - a number
1569 1569
1570 1570 Set angle measurement units, i. e. set number
1571 - of 'degrees' for a full circle. Dafault value is
1571 + of 'degrees' for a full circle. Default value is
1572 1572 360 degrees.
1573 1573
1574 1574 Example (for a Turtle instance named turtle):
Original file line number Diff line number Diff line change
@@ -2170,7 +2170,7 @@ _PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg,
2170 2170 fprintf(stderr, "<object: freed type %p>\n", (void *)Py_TYPE(obj));
2171 2171 }
2172 2172 else {
2173 -/* Diplay the traceback where the object has been allocated.
2173 +/* Display the traceback where the object has been allocated.
2174 2174 Do it before dumping repr(obj), since repr() is more likely
2175 2175 to crash than dumping the traceback. */
2176 2176 void *ptr;