diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index fd63495674651b..a89a69043c0f9f 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -214,7 +214,7 @@ and initialize it by calling :c:func:`PyErr_NewException` in the module's SpamError = PyErr_NewException("spam.error", NULL, NULL); -Since :c:data:`!SpamError` is a global variable, it will be overwitten every time +Since :c:data:`!SpamError` is a global variable, it will be overwritten every time the module is reinitialized, when the :c:data:`Py_mod_exec` function is called. For now, let's avoid the issue: we will block repeated initialization by raising an diff --git a/Doc/library/shelve.rst b/Doc/library/shelve.rst index 23808619524056..b88fe4157bdc29 100644 --- a/Doc/library/shelve.rst +++ b/Doc/library/shelve.rst @@ -144,7 +144,7 @@ Restrictions which can cause hard crashes when trying to read from the database. * :meth:`Shelf.reorganize` may not be available for all database packages and - may temporarely increase resource usage (especially disk space) when called. + may temporarily increase resource usage (especially disk space) when called. Additionally, it will never run automatically and instead needs to be called explicitly. diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index c108a94692dca7..bf17f417a5980e 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -1051,7 +1051,7 @@ Concurrent safe warnings control The :class:`warnings.catch_warnings` context manager will now optionally use a context variable for warning filters. This is enabled by setting the :data:`~sys.flags.context_aware_warnings` flag, either with the ``-X`` -command-line option or an environment variable. This gives predicable +command-line option or an environment variable. This gives predictable warnings control when using :class:`~warnings.catch_warnings` combined with multiple threads or asynchronous tasks. The flag defaults to true for the free-threaded build and false for the GIL-enabled build. diff --git a/Include/cpython/critical_section.h b/Include/cpython/critical_section.h index 35db3fb6a59ce6..4d48ba13451304 100644 --- a/Include/cpython/critical_section.h +++ b/Include/cpython/critical_section.h @@ -93,7 +93,7 @@ PyCriticalSection2_End(PyCriticalSection2 *c); } #else /* !Py_GIL_DISABLED */ -// NOTE: the contents of this struct are private and may change betweeen +// NOTE: the contents of this struct are private and may change between // Python releases without a deprecation period. struct PyCriticalSection { // Tagged pointer to an outer active critical section (or 0). @@ -105,7 +105,7 @@ struct PyCriticalSection { // A critical section protected by two mutexes. Use // Py_BEGIN_CRITICAL_SECTION2 and Py_END_CRITICAL_SECTION2. -// NOTE: the contents of this struct are private and may change betweeen +// NOTE: the contents of this struct are private and may change between // Python releases without a deprecation period. struct PyCriticalSection2 { PyCriticalSection _cs_base; diff --git a/Include/internal/pycore_pymem.h b/Include/internal/pycore_pymem.h index f3f2ae0a140828..cf283cbbd7297d 100644 --- a/Include/internal/pycore_pymem.h +++ b/Include/internal/pycore_pymem.h @@ -94,7 +94,7 @@ extern void _PyMem_FreeDelayed(void *ptr, size_t size); extern void _PyMem_ProcessDelayed(PyThreadState *tstate); // Periodically process delayed free requests when the world is stopped. -// Notify of any objects whic should be freeed. +// Notify of any objects which should be freed. typedef void (*delayed_dealloc_cb)(PyObject *, void *); extern void _PyMem_ProcessDelayedNoDealloc(PyThreadState *tstate, delayed_dealloc_cb cb, void *state); diff --git a/Include/modsupport.h b/Include/modsupport.h index af995f567b004c..0b205548f0dc96 100644 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -33,7 +33,7 @@ PyAPI_FUNC(int) PyModule_Add(PyObject *mod, const char *name, PyObject *value); // Similar to PyModule_AddObjectRef() and PyModule_Add() but steal // a reference to 'value' on success and only on success. -// Errorprone. Should not be used in new code. +// Error-prone. Should not be used in new code. PyAPI_FUNC(int) PyModule_AddObject(PyObject *mod, const char *, PyObject *value); PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long); diff --git a/Include/refcount.h b/Include/refcount.h index ba34461fefcbb0..b155d19d7f858f 100644 --- a/Include/refcount.h +++ b/Include/refcount.h @@ -453,7 +453,7 @@ static inline Py_ALWAYS_INLINE void Py_DECREF(PyObject *op) * There are cases where it's safe to use the naive code, but they're brittle. * For example, if `op` points to a Python integer, you know that destroying * one of those can't cause problems -- but in part that relies on that - * Python integers aren't currently weakly referencable. Best practice is + * Python integers aren't currently weakly referenceable. Best practice is * to use Py_CLEAR() even if you can't think of a reason for why you need to. * * gh-98724: Use a temporary variable to only evaluate the macro argument once, diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index b72d581ec25804..b98f44887ae827 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -760,7 +760,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_Split( Py_ssize_t maxsplit /* Maxsplit count */ ); -/* Dito, but split at line breaks. +/* Ditto, but split at line breaks. CRLF is considered to be one line break. Line breaks are not included in the resulting list. */ diff --git a/InternalDocs/asyncio.md b/InternalDocs/asyncio.md index 22159852ca54db..ca7e8a92dec1ce 100644 --- a/InternalDocs/asyncio.md +++ b/InternalDocs/asyncio.md @@ -205,7 +205,7 @@ the current task is found and returned. If no matching thread state is found, `None` is returned. In free-threading, it avoids contention on a global dictionary as -threads can access the current task of thier running loop without any +threads can access the current task of their running loop without any locking. --- diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 2c3925958d011b..e663e55ad6ebc1 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -1524,7 +1524,7 @@ def _pop(self, timeout, default=('', None)): # Historical Note: # The timeout was originally implemented using select() after # checking for the presence of already-buffered data. - # That allowed timeouts on pipe connetions like IMAP4_stream. + # That allowed timeouts on pipe connections like IMAP4_stream. # However, it seemed possible that SSL data arriving without any # IMAP data afterward could cause select() to indicate available # application data when there was none, leading to a read() call diff --git a/Lib/multiprocessing/resource_tracker.py b/Lib/multiprocessing/resource_tracker.py index 05633ac21a259c..14ff2cc927b56b 100644 --- a/Lib/multiprocessing/resource_tracker.py +++ b/Lib/multiprocessing/resource_tracker.py @@ -76,7 +76,7 @@ def _reentrant_call_error(self): "Reentrant call into the multiprocessing resource tracker") def __del__(self): - # making sure child processess are cleaned before ResourceTracker + # making sure child processes are cleaned before ResourceTracker # gets destructed. # see https://github.com/python/cpython/issues/88887 self._stop(use_blocking_lock=False) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py index 49e0986517ce97..e36cafa26d2721 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -364,7 +364,7 @@ def _get_sysconfigdata(): def _installation_is_relocated(): - """Is the Python installation running from a different prefix than what was targetted when building?""" + """Is the Python installation running from a different prefix than what was targeted when building?""" if os.name != 'posix': raise NotImplementedError('sysconfig._installation_is_relocated() is currently only supported on POSIX') diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index 3e304c166425b0..859175858e5f96 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -116,7 +116,7 @@ def test_connection_lost_when_busy(self): sock.fileno = mock.Mock(return_value=12345) sock.send = mock.Mock(side_effect=BrokenPipeError) - # construct StreamWriter chain that contains loop dependant logic this emulates + # construct StreamWriter chain that contains loop dependent logic this emulates # what _make_ssl_transport() does in BaseSelectorEventLoop reader = asyncio.StreamReader(limit=2 ** 16, loop=self.loop) protocol = asyncio.StreamReaderProtocol(reader, loop=self.loop) diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py index 19582e757161fc..b6afddb0f35428 100644 --- a/Lib/test/test_buffer.py +++ b/Lib/test/test_buffer.py @@ -4456,7 +4456,7 @@ def test_pybuffer_size_from_format(self): @support.cpython_only def test_flags_overflow(self): - # gh-126594: Check for integer overlow on large flags + # gh-126594: Check for integer overflow on large flags try: from _testcapi import INT_MIN, INT_MAX except ImportError: diff --git a/Lib/test/test_build_details.py b/Lib/test/test_build_details.py index ba4b8c5aa9b58e..d7a718139953b0 100644 --- a/Lib/test/test_build_details.py +++ b/Lib/test/test_build_details.py @@ -11,7 +11,7 @@ class FormatTestsBase: @property def contents(self): - """Install details file contents. Should be overriden by subclasses.""" + """Install details file contents. Should be overridden by subclasses.""" raise NotImplementedError @property @@ -114,7 +114,7 @@ def contents(self): def test_location(self): self.assertTrue(os.path.isfile(self.location)) - # Override generic format tests with tests for our specific implemenation. + # Override generic format tests with tests for our specific implementation. @needs_installed_python @unittest.skipIf( diff --git a/Lib/test/test_capi/test_tuple.py b/Lib/test/test_capi/test_tuple.py index 7c07bc64e247c5..0eb70ff68f32f5 100644 --- a/Lib/test/test_capi/test_tuple.py +++ b/Lib/test/test_capi/test_tuple.py @@ -259,7 +259,7 @@ def test__tuple_resize(self): def test_bug_59313(self): # Before 3.14, the C-API function PySequence_Tuple # would create incomplete tuples which were visible to - # the cycle GC, and this test would crash the interpeter. + # the cycle GC, and this test would crash the interpreter. TAG = object() tuples = [] diff --git a/Lib/test/test_capi/test_type.py b/Lib/test/test_capi/test_type.py index 15fb4a93e2ad74..dd660216770dde 100644 --- a/Lib/test/test_capi/test_type.py +++ b/Lib/test/test_capi/test_type.py @@ -259,7 +259,7 @@ class FreezeThis(metaclass=Meta): self.assertEqual(FreezeThis.value, 2) def test_manual_heap_type(self): - # gh-128923: test that a manually allocated and initailized heap type + # gh-128923: test that a manually allocated and initialized heap type # works correctly ManualHeapType = _testcapi.ManualHeapType for i in range(100): diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index f30a1874ab96d4..cc3802a90a850f 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -980,7 +980,7 @@ def test_python_legacy_windows_fs_encoding(self): def test_python_legacy_windows_stdio(self): # Test that _WindowsConsoleIO is used when PYTHONLEGACYWINDOWSSTDIO # is not set. - # We cannot use PIPE becase it prevents creating new console. + # We cannot use PIPE because it prevents creating new console. # So we use exit code. code = "import sys; sys.exit(type(sys.stdout.buffer.raw).__name__ != '_WindowsConsoleIO')" env = os.environ.copy() diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py index 60c62430370e96..4888bf10a983d5 100644 --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -1581,7 +1581,7 @@ def check_unhashable_key(): with check_unhashable_key(): d.get(key) - # Only TypeError exception is overriden, + # Only TypeError exception is overridden, # other exceptions are left unchanged. class HashError: def __hash__(self): diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index 355990ed58ee09..fc3d53271d1c0b 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -1696,7 +1696,7 @@ def jumpy(): # code_object_inner before rerunning the tests def _stringify_instruction(instr): - # Since postions offsets change a lot for these test cases, ignore them. + # Since positions offsets change a lot for these test cases, ignore them. base = ( f" make_inst(opname={instr.opname!r}, arg={instr.arg!r}, argval={instr.argval!r}, " + f"argrepr={instr.argrepr!r}, offset={instr.offset}, start_offset={instr.start_offset}, " + diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py index e3d54f6315aade..2e5b894fd5b063 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py @@ -388,7 +388,7 @@ def check_readall(name, code, prelude="", cleanup="", syscalls = strace_helper.filter_memory(syscalls) # The first call should be an open that returns a - # file descriptor (fd). Afer that calls may vary. Once the file + # file descriptor (fd). After that calls may vary. Once the file # is opened, check calls refer to it by fd as the filename # could be removed from the filesystem, renamed, etc. See: # Time-of-check time-of-use (TOCTOU) software bug class. diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index 3e41c7b9663491..7ce84ca0a3bb42 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -2377,7 +2377,7 @@ def printsolution(self, x): """ weakref_tests = """\ -Generators are weakly referencable: +Generators are weakly referenceable: >>> import weakref >>> def gen(): @@ -2388,7 +2388,7 @@ def printsolution(self, x): True >>> p = weakref.proxy(gen) -Generator-iterators are weakly referencable as well: +Generator-iterators are weakly referenceable as well: >>> gi = gen() >>> wr = weakref.ref(gi) diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py index fe5f18fa3f88a0..639c8fde612091 100644 --- a/Lib/test/test_genexps.py +++ b/Lib/test/test_genexps.py @@ -256,7 +256,7 @@ >>> me.gi_running 0 -Verify that genexps are weakly referencable +Verify that genexps are weakly referenceable >>> import weakref >>> g = (i*i for i in range(4)) diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index a12ff5662a73db..df4748057ab254 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -144,7 +144,7 @@ def test_read1(self): self.assertEqual(b''.join(blocks), data1 * 50) def test_readinto(self): - # 10MB of uncompressible data to ensure multiple reads + # 10MB of incompressible data to ensure multiple reads large_data = os.urandom(10 * 2**20) with gzip.GzipFile(self.filename, 'wb') as f: f.write(large_data) @@ -156,7 +156,7 @@ def test_readinto(self): self.assertEqual(buf, large_data) def test_readinto1(self): - # 10MB of uncompressible data to ensure multiple reads + # 10MB of incompressible data to ensure multiple reads large_data = os.urandom(10 * 2**20) with gzip.GzipFile(self.filename, 'wb') as f: f.write(large_data) diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 275f7ce47d09b5..e82dc611baac61 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -2387,7 +2387,7 @@ def __getattr__(self, attribute): return getattr(queue, attribute) class CustomQueueFakeProtocol(CustomQueueProtocol): - # An object implementing the minimial Queue API for + # An object implementing the minimal Queue API for # the logging module but with incorrect signatures. # # The object will be considered a valid queue class since we diff --git a/Lib/test/test_memoryview.py b/Lib/test/test_memoryview.py index 64f440f180bbf0..653b8e0eeba6bd 100644 --- a/Lib/test/test_memoryview.py +++ b/Lib/test/test_memoryview.py @@ -738,7 +738,7 @@ def test_picklebuffer_reference_loop(self): @support.requires_resource("cpu") class RacingTest(unittest.TestCase): def test_racing_getbuf_and_releasebuf(self): - """Repeatly access the memoryview for racing.""" + """Repeatedly access the memoryview for racing.""" try: from multiprocessing.managers import SharedMemoryManager except ImportError: diff --git a/Lib/test/test_opcache.py b/Lib/test/test_opcache.py index 30baa09048616c..4f4a9516d8411b 100644 --- a/Lib/test/test_opcache.py +++ b/Lib/test/test_opcache.py @@ -571,7 +571,7 @@ def test(default=None): def make_deferred_ref_count_obj(): """Create an object that uses deferred reference counting. - Only objects that use deferred refence counting may be stored in inline + Only objects that use deferred reference counting may be stored in inline caches in free-threaded builds. This constructs a new class named Foo, which uses deferred reference counting. """ diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py index a0c76e5dec5ebe..5b420cb54a2e68 100644 --- a/Lib/test/test_plistlib.py +++ b/Lib/test/test_plistlib.py @@ -858,7 +858,7 @@ def test_load_aware_datetime(self): self.assertEqual(dt.tzinfo, datetime.UTC) @unittest.skipUnless("America/Los_Angeles" in zoneinfo.available_timezones(), - "Can't find timezone datebase") + "Can't find timezone database") def test_dump_aware_datetime(self): dt = datetime.datetime(2345, 6, 7, 8, 9, 10, tzinfo=zoneinfo.ZoneInfo("America/Los_Angeles")) @@ -877,7 +877,7 @@ def test_dump_utc_aware_datetime(self): self.assertEqual(loaded_dt, dt) @unittest.skipUnless("America/Los_Angeles" in zoneinfo.available_timezones(), - "Can't find timezone datebase") + "Can't find timezone database") def test_dump_aware_datetime_without_aware_datetime_option(self): dt = datetime.datetime(2345, 6, 7, 8, tzinfo=zoneinfo.ZoneInfo("America/Los_Angeles")) @@ -1032,7 +1032,7 @@ def test_load_aware_datetime(self): datetime.datetime(2345, 6, 7, 8, tzinfo=datetime.UTC)) @unittest.skipUnless("America/Los_Angeles" in zoneinfo.available_timezones(), - "Can't find timezone datebase") + "Can't find timezone database") def test_dump_aware_datetime_without_aware_datetime_option(self): dt = datetime.datetime(2345, 6, 7, 8, tzinfo=zoneinfo.ZoneInfo("America/Los_Angeles")) diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index 4836f38c388c05..9b2ffd1e375ab5 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -53,7 +53,7 @@ def normalize_output(data): # etc.) # This is about the best we can do without getting some feedback - # from someone more knowledgable. + # from someone more knowledgeable. # OSF/1 (Tru64) apparently turns \n into \r\r\n. if data.endswith(b'\r\r\n'): diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index 657a971f8769df..6997a9223f8b0d 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -1005,7 +1005,7 @@ def test_builtin_completion_top_level(self): # Make iter_modules() search only the standard library. # This makes the test more reliable in case there are # other user packages/scripts on PYTHONPATH which can - # intefere with the completions. + # interfere with the completions. lib_path = os.path.dirname(importlib.__path__[0]) sys.path = [lib_path] diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index c0df9507bd7f5e..203a231201c669 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -661,7 +661,7 @@ def check_unhashable_element(): with check_unhashable_element(): myset.discard(elem) - # Only TypeError exception is overriden, + # Only TypeError exception is overridden, # other exceptions are left unchanged. class HashError: def __hash__(self): diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py index 8250b0aef09aec..6eb7f15cbfe3f3 100644 --- a/Lib/test/test_statistics.py +++ b/Lib/test/test_statistics.py @@ -2998,7 +2998,7 @@ def test_cdf(self): X = NormalDist(100, 15) cdfs = [X.cdf(x) for x in range(1, 200)] self.assertEqual(set(map(type, cdfs)), {float}) - # Verify montonic + # Verify monotonic self.assertEqual(cdfs, sorted(cdfs)) # Verify center (should be exact) self.assertEqual(X.cdf(100), 0.50) diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index f0e350c71f60ea..4287765c60348d 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -3438,7 +3438,7 @@ def test_vfork_used_when_expected(self): # because libc tends to implement that internally using vfork. But # that'd just be testing a libc+kernel implementation detail. - # Are intersted in the system calls: + # Are interested in the system calls: # clone,clone2,clone3,fork,vfork,exit,exit_group # Unfortunately using `--trace` with that list to strace fails because # not all are supported on all platforms (ex. clone2 is ia64 only...) diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index 2eb8de4b29fe96..f2c9848eefc45f 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -697,7 +697,7 @@ def test_sysconfigdata_json(self): # Keys dependent on uncontrollable external context ignore_keys = {'userbase'} - # Keys dependent on Python being run outside the build directrory + # Keys dependent on Python being run outside the build directory if sysconfig.is_python_build(): ignore_keys |= {'srcdir'} # Keys dependent on the executable location @@ -706,7 +706,7 @@ def test_sysconfigdata_json(self): # Keys dependent on the environment (different inside virtual environments) if sys.prefix != sys.base_prefix: ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase'} - # Keys dependent on Python being run from the prefix targetted when building (different on relocatable installs) + # Keys dependent on Python being run from the prefix targeted when building (different on relocatable installs) if sysconfig._installation_is_relocated(): ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase', 'installed_base', 'installed_platbase'} diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 7055e1ed147a9e..db4028a5d3677c 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -4112,7 +4112,7 @@ def test_sneaky_hardlink_fallback(self): arc.add("b/") # Point "c" to the bottom of the tree in "a" arc.add("c", symlink_to=os.path.join("a", "t")) - # link to non-existant location under "a" + # link to non-existent location under "a" arc.add("c/escape", symlink_to=os.path.join("..", "..", "link_here")) # Move "c" to point to "b" ("c/escape" no longer exists) diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py index 4c7c900eb56ae1..55299995e6e08b 100644 --- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -1857,7 +1857,7 @@ def test_weak_keyed_bad_delitem(self): self.assertRaises(KeyError, d.__delitem__, o) self.assertRaises(KeyError, d.__getitem__, o) - # If a key isn't of a weakly referencable type, __getitem__ and + # If a key isn't of a weakly referenceable type, __getitem__ and # __setitem__ raise TypeError. __delitem__ should too. self.assertRaises(TypeError, d.__delitem__, 13) self.assertRaises(TypeError, d.__getitem__, 13) @@ -2260,7 +2260,7 @@ def test_names(self): >>> class Dict(dict): ... pass ... ->>> obj = Dict(red=1, green=2, blue=3) # this object is weak referencable +>>> obj = Dict(red=1, green=2, blue=3) # this object is weak referenceable >>> r = weakref.ref(obj) >>> print(r() is obj) True diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index bf6d5074fdebd8..5e4b704f869e1f 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -2736,7 +2736,7 @@ def test_remove_with_clear_assume_existing(self): def do_test_remove_with_clear(self, *, raises): - # Until the discrepency between "del root[:]" and "root.clear()" is + # Until the discrepancy between "del root[:]" and "root.clear()" is # resolved, we need to keep two tests. Previously, using "del root[:]" # did not crash with the reproducer of gh-126033 while "root.clear()" # did. diff --git a/Misc/NEWS.d/3.14.0b1.rst b/Misc/NEWS.d/3.14.0b1.rst index 041fbaf2051719..02ceb82b556386 100644 --- a/Misc/NEWS.d/3.14.0b1.rst +++ b/Misc/NEWS.d/3.14.0b1.rst @@ -1756,7 +1756,7 @@ Add support for macOS multi-arch builds with the JIT enabled .. nonce: q9fvyM .. section: Core and Builtins -PyREPL now supports syntax highlighing. Contributed by Łukasz Langa. +PyREPL now supports syntax highlighting. Contributed by Łukasz Langa. .. @@ -1797,7 +1797,7 @@ non-``None`` ``closure``. Patch by Bartosz Sławecki. .. nonce: Uj7lyY .. section: Core and Builtins -Fix a bug that was allowing newlines inconsitently in format specifiers for +Fix a bug that was allowing newlines inconsistently in format specifiers for single-quoted f-strings. Patch by Pablo Galindo. .. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-07-19-12-37-05.gh-issue-136801.XU_tF2.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-07-19-12-37-05.gh-issue-136801.XU_tF2.rst index 5c0813b1a0abda..767d7b97726971 100644 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-07-19-12-37-05.gh-issue-136801.XU_tF2.rst +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-07-19-12-37-05.gh-issue-136801.XU_tF2.rst @@ -1 +1 @@ -Fix PyREPL syntax highlightning on match cases after multi-line case. Contributed by Olga Matoula. +Fix PyREPL syntax highlighting on match cases after multi-line case. Contributed by Olga Matoula. diff --git a/Misc/NEWS.d/next/Library/2025-07-05-09-45-04.gh-issue-136286.N67Amr.rst b/Misc/NEWS.d/next/Library/2025-07-05-09-45-04.gh-issue-136286.N67Amr.rst index 0a0d66ac0b8abf..ddc2310392fe92 100644 --- a/Misc/NEWS.d/next/Library/2025-07-05-09-45-04.gh-issue-136286.N67Amr.rst +++ b/Misc/NEWS.d/next/Library/2025-07-05-09-45-04.gh-issue-136286.N67Amr.rst @@ -1,2 +1,2 @@ -Fix pickling failures for protocols 0 and 1 for many objects realted to +Fix pickling failures for protocols 0 and 1 for many objects related to subinterpreters. diff --git a/Misc/NEWS.d/next/Tools-Demos/2025-06-11-12-14-06.gh-issue-135379.25ttXq.rst b/Misc/NEWS.d/next/Tools-Demos/2025-06-11-12-14-06.gh-issue-135379.25ttXq.rst index 25599a865b7246..ebe3ab0e7d1993 100644 --- a/Misc/NEWS.d/next/Tools-Demos/2025-06-11-12-14-06.gh-issue-135379.25ttXq.rst +++ b/Misc/NEWS.d/next/Tools-Demos/2025-06-11-12-14-06.gh-issue-135379.25ttXq.rst @@ -1,4 +1,4 @@ The cases generator no longer accepts type annotations on stack items. -Conversions to non-default types are now done explictly in bytecodes.c and +Conversions to non-default types are now done explicitly in bytecodes.c and optimizer_bytecodes.c. This will simplify code generation for top-of-stack caching and other future features. diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in index 86c8eb27c0a6c7..3c6ee659e744af 100644 --- a/Modules/Setup.stdlib.in +++ b/Modules/Setup.stdlib.in @@ -85,7 +85,7 @@ # # Since the compilation of the built-in cryptographic modules depends # on whether we are building on WASI or not, rules will be explicitly -# written. In the future, it should be preferrable to be able to setup +# written. In the future, it should be preferable to be able to setup # the relevant bits here instead of in Makefile.pre.in or configure.ac. # Hash functions can be disabled with --without-builtin-hashlib-hashes. diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 1c888295cb07f1..e4d32415d2be0c 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -503,7 +503,7 @@ partial_vectorcall(PyObject *self, PyObject *const *args, assert(i == pto_nkwds); Py_XDECREF(pto_kw_merged); - /* Resize Stack if the removing overallocation saves some noticable memory + /* Resize Stack if the removing overallocation saves some noticeable memory * NOTE: This whole block can be removed without breaking anything */ Py_ssize_t noveralloc = n_merges + nkwds; if (stack != small_stack && noveralloc > 6 && noveralloc > init_stack_size / 10) { diff --git a/Modules/_zstd/_zstdmodule.c b/Modules/_zstd/_zstdmodule.c index d75c0779474a82..75477b132ee452 100644 --- a/Modules/_zstd/_zstdmodule.c +++ b/Modules/_zstd/_zstdmodule.c @@ -1,4 +1,4 @@ -/* Low level interface to the Zstandard algorthm & the zstd library. */ +/* Low level interface to the Zstandard algorithm & the zstd library. */ #ifndef Py_BUILD_CORE_BUILTIN # define Py_BUILD_CORE_MODULE 1 @@ -497,12 +497,12 @@ _zstd.get_frame_info frame_buffer: Py_buffer A bytes-like object, containing the header of a Zstandard frame. -Get Zstandard frame infomation from a frame header. +Get Zstandard frame information from a frame header. [clinic start generated code]*/ static PyObject * _zstd_get_frame_info_impl(PyObject *module, Py_buffer *frame_buffer) -/*[clinic end generated code: output=56e033cf48001929 input=94b240583ae22ca5]*/ +/*[clinic end generated code: output=56e033cf48001929 input=6b350490b0f58ede]*/ { uint64_t decompressed_size; uint32_t dict_id; diff --git a/Modules/_zstd/_zstdmodule.h b/Modules/_zstd/_zstdmodule.h index 4e8f708f2232c7..82226ff8718e6b 100644 --- a/Modules/_zstd/_zstdmodule.h +++ b/Modules/_zstd/_zstdmodule.h @@ -1,4 +1,4 @@ -/* Low level interface to the Zstandard algorthm & the zstd library. */ +/* Low level interface to the Zstandard algorithm & the zstd library. */ /* Declarations shared between different parts of the _zstd module*/ diff --git a/Modules/_zstd/buffer.h b/Modules/_zstd/buffer.h index 4c885fa0d720fd..0ac7bcb4ddc416 100644 --- a/Modules/_zstd/buffer.h +++ b/Modules/_zstd/buffer.h @@ -1,4 +1,4 @@ -/* Low level interface to the Zstandard algorthm & the zstd library. */ +/* Low level interface to the Zstandard algorithm & the zstd library. */ #ifndef ZSTD_BUFFER_H #define ZSTD_BUFFER_H diff --git a/Modules/_zstd/clinic/_zstdmodule.c.h b/Modules/_zstd/clinic/_zstdmodule.c.h index 766e1cfa776767..feb0563b322838 100644 --- a/Modules/_zstd/clinic/_zstdmodule.c.h +++ b/Modules/_zstd/clinic/_zstdmodule.c.h @@ -289,7 +289,7 @@ PyDoc_STRVAR(_zstd_get_frame_info__doc__, "get_frame_info($module, /, frame_buffer)\n" "--\n" "\n" -"Get Zstandard frame infomation from a frame header.\n" +"Get Zstandard frame information from a frame header.\n" "\n" " frame_buffer\n" " A bytes-like object, containing the header of a Zstandard frame."); @@ -426,4 +426,4 @@ _zstd_set_parameter_types(PyObject *module, PyObject *const *args, Py_ssize_t na exit: return return_value; } -/*[clinic end generated code: output=437b084f149e68e5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a6ad0ab41c507911 input=a9049054013a1b77]*/ diff --git a/Modules/_zstd/compressor.c b/Modules/_zstd/compressor.c index bc9e6eff89af68..dcd4513f9a7414 100644 --- a/Modules/_zstd/compressor.c +++ b/Modules/_zstd/compressor.c @@ -1,4 +1,4 @@ -/* Low level interface to the Zstandard algorthm & the zstd library. */ +/* Low level interface to the Zstandard algorithm & the zstd library. */ /* ZstdCompressor class definitions */ @@ -713,7 +713,7 @@ _zstd_ZstdCompressor_set_pledged_input_size_impl(ZstdCompressor *self, unsigned long long size) /*[clinic end generated code: output=3a09e55cc0e3b4f9 input=afd8a7d78cff2eb5]*/ { - // Error occured while converting argument, should be unreachable + // Error occurred while converting argument, should be unreachable assert(size != ZSTD_CONTENTSIZE_ERROR); /* Thread-safe code */ diff --git a/Modules/_zstd/decompressor.c b/Modules/_zstd/decompressor.c index c53d6e4cb05cf0..b00ee05d2f51bf 100644 --- a/Modules/_zstd/decompressor.c +++ b/Modules/_zstd/decompressor.c @@ -1,4 +1,4 @@ -/* Low level interface to the Zstandard algorthm & the zstd library. */ +/* Low level interface to the Zstandard algorithm & the zstd library. */ /* ZstdDecompressor class definition */ diff --git a/Modules/_zstd/zstddict.c b/Modules/_zstd/zstddict.c index 14f74aaed46ec5..35d6ca8e55a265 100644 --- a/Modules/_zstd/zstddict.c +++ b/Modules/_zstd/zstddict.c @@ -1,4 +1,4 @@ -/* Low level interface to the Zstandard algorthm & the zstd library. */ +/* Low level interface to the Zstandard algorithm & the zstd library. */ /* ZstdDict class definitions */ diff --git a/Modules/_zstd/zstddict.h b/Modules/_zstd/zstddict.h index 4a403416dbd4a3..e0d3f46b2b14a6 100644 --- a/Modules/_zstd/zstddict.h +++ b/Modules/_zstd/zstddict.h @@ -1,4 +1,4 @@ -/* Low level interface to the Zstandard algorthm & the zstd library. */ +/* Low level interface to the Zstandard algorithm & the zstd library. */ #ifndef ZSTD_DICT_H #define ZSTD_DICT_H diff --git a/Modules/hmacmodule.c b/Modules/hmacmodule.c index 95e400231bb65c..b11e97e52dde8b 100644 --- a/Modules/hmacmodule.c +++ b/Modules/hmacmodule.c @@ -649,7 +649,7 @@ find_hash_info(hmacmodule_state *state, PyObject *hash_info_ref) { const py_hmac_hinfo *info = NULL; int rc = find_hash_info_impl(state, hash_info_ref, &info); - // The code below could be simplfied with only 'rc == 0' case, + // The code below could be simplified with only 'rc == 0' case, // but we are deliberately verbose to ease future improvements. if (rc < 0) { return NULL; diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 47eaf5cd428a53..46a528afdc155c 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5830,7 +5830,7 @@ os_nice_impl(PyObject *module, int increment) /* There are two flavours of 'nice': one that returns the new priority (as required by almost all standards out there) and the - Linux/FreeBSD one, which returns '0' on success and advices + Linux/FreeBSD one, which returns '0' on success and advises the use of getpriority() to get the new priority. If we are of the nice family that returns the new priority, we diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 42e021679b583f..223bb747ca2de4 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -2012,7 +2012,7 @@ _PyCode_CheckNoExternalState(PyCodeObject *co, _PyCode_var_counts_t *counts, errmsg = "globals not supported"; } // Otherwise we don't check counts.unbound.globals.numunknown since we can't - // distinguish beween globals and builtins here. + // distinguish between globals and builtins here. if (errmsg != NULL) { if (p_errmsg != NULL) { @@ -2123,7 +2123,7 @@ code_returns_only_none(PyCodeObject *co) for (int i = 0; i < len; i += _PyInstruction_GetLength(co, i)) { _Py_CODEUNIT inst = _Py_GetBaseCodeUnit(co, i); if (IS_RETURN_OPCODE(inst.op.code)) { - // We alraedy know it isn't returning None. + // We already know it isn't returning None. return 0; } } diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 379c4d0467c487..ce7d6c6a9c093d 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4880,7 +4880,7 @@ type_new_impl(type_new_ctx *ctx) assert(_PyType_CheckConsistency(type)); #if defined(Py_GIL_DISABLED) && defined(Py_DEBUG) && SIZEOF_VOID_P > 4 - // After this point, other threads can potentally use this type. + // After this point, other threads can potentially use this type. ((PyObject*)type)->ob_flags |= _Py_TYPE_REVEALED_FLAG; #endif @@ -5597,7 +5597,7 @@ PyType_FromMetaclass( assert(_PyType_CheckConsistency(type)); #if defined(Py_GIL_DISABLED) && defined(Py_DEBUG) && SIZEOF_VOID_P > 4 - // After this point, other threads can potentally use this type. + // After this point, other threads can potentially use this type. ((PyObject*)type)->ob_flags |= _Py_TYPE_REVEALED_FLAG; #endif diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 5c2308a012142a..63d14069fcdd5a 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -14289,7 +14289,7 @@ unicode_getnewargs(PyObject *v, PyObject *Py_UNUSED(ignored)) } /* -This function searchs the longest common leading whitespace +This function searches the longest common leading whitespace of all lines in the [src, end). It returns the length of the common leading whitespace and sets `output` to point to the beginning of the common leading whitespace if length > 0. diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index cf35e705f355a7..f3fb0ad44c1705 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -127,7 +127,7 @@ diff --git a/Parser/lexer/lexer.c b/Parser/lexer/lexer.c index 81363cf8e810fe..ace1bced5bd733 100644 --- a/Parser/lexer/lexer.c +++ b/Parser/lexer/lexer.c @@ -137,7 +137,7 @@ set_ftstring_expr(struct tok_state* tok, struct token *token, char c) { // Handle quotes if (ch == '"' || ch == '\'') { - // The following if/else block works becase there is an off number + // The following if/else block works because there is an off number // of quotes in STRING tokens and the lexer only ever reaches this // function with valid STRING tokens. // For example: """hello""" diff --git a/Python/crossinterp.c b/Python/crossinterp.c index 16a23f0351cd26..ce361ae363e5fb 100644 --- a/Python/crossinterp.c +++ b/Python/crossinterp.c @@ -772,7 +772,7 @@ _PyPickle_GetXIData(PyThreadState *tstate, PyObject *obj, _PyXIData_t *xidata) return -1; } - // If we had an "unwrapper" mechnanism, we could call + // If we had an "unwrapper" mechanism, we could call // _PyObject_GetXIData() on the bytes object directly and add // a simple unwrapper to call pickle.loads() on the bytes. size_t size = sizeof(struct _shared_pickle_data); @@ -3176,7 +3176,7 @@ _PyXI_InitTypes(PyInterpreterState *interp) "failed to initialize the cross-interpreter exception types"); } // We would initialize heap types here too but that leads to ref leaks. - // Instead, we intialize them in _PyXI_Init(). + // Instead, we initialize them in _PyXI_Init(). return _PyStatus_OK(); } diff --git a/Python/gc.c b/Python/gc.c index 4160f68c27a3ef..d485a0d0b17e6f 100644 --- a/Python/gc.c +++ b/Python/gc.c @@ -1,6 +1,6 @@ // This implements the reference cycle garbage collector. // The Python module interface to the collector is in gcmodule.c. -// See InternalDocs/garbage_collector.md for more infromation. +// See InternalDocs/garbage_collector.md for more information. #include "Python.h" #include "pycore_ceval.h" // _Py_set_eval_breaker_bit() diff --git a/Python/gc_free_threading.c b/Python/gc_free_threading.c index 0b0ddf227e4952..9a9e28c5982fd6 100644 --- a/Python/gc_free_threading.c +++ b/Python/gc_free_threading.c @@ -529,7 +529,7 @@ static_assert(BUFFER_HI < BUFFER_SIZE && BUFFER_LO > 0, "Invalid prefetch buffer level settings."); -// Prefetch intructions will fetch the line of data from memory that +// Prefetch instructions will fetch the line of data from memory that // contains the byte specified with the source operand to a location in // the cache hierarchy specified by a locality hint. The instruction // is only a hint and the CPU is free to ignore it. Instructions and @@ -581,7 +581,7 @@ static_assert(BUFFER_HI < BUFFER_SIZE && #define prefetch(ptr) #endif -// a contigous sequence of PyObject pointers, can contain NULLs +// a contiguous sequence of PyObject pointers, can contain NULLs typedef struct { PyObject **start; PyObject **end; @@ -750,7 +750,7 @@ gc_mark_enqueue(PyObject *op, gc_mark_args_t *args) } } -// Called when we have a contigous sequence of PyObject pointers, either +// Called when we have a contiguous sequence of PyObject pointers, either // a tuple or list object. This will add the items to the buffer if there // is space for them all otherwise push a new "span" on the span stack. Using // spans has the advantage of not creating a deep _PyObjectStack stack when diff --git a/Python/pystate.c b/Python/pystate.c index 0d4c26f92cec90..3a9fad3f6346ae 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -543,7 +543,7 @@ init_interpreter(PyInterpreterState *interp, interp->threads.preallocated = &interp->_initial_thread; // We would call _PyObject_InitState() at this point - // if interp->feature_flags were alredy set. + // if interp->feature_flags were already set. _PyEval_InitState(interp); _PyGC_InitState(&interp->gc); diff --git a/Python/remote_debug.h b/Python/remote_debug.h index 5324a7aaa6f5e5..fa6e149e82f8ca 100644 --- a/Python/remote_debug.h +++ b/Python/remote_debug.h @@ -1119,7 +1119,7 @@ _Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle, } if (_Py_RemoteDebug_ReadRemoteMemory(handle, page_base, page_size, entry->data) < 0) { - // Try to just copy the exact ammount as a fallback + // Try to just copy the exact amount as a fallback PyErr_Clear(); goto fallback; } diff --git a/Python/specialize.c b/Python/specialize.c index fe8d04cf3442f1..04f50c9ea8ee4c 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -2544,7 +2544,7 @@ static _PyBinaryOpSpecializationDescr binaryop_extend_descrs[] = { {NB_INPLACE_AND, compactlongs_guard, compactlongs_and}, {NB_INPLACE_XOR, compactlongs_guard, compactlongs_xor}, - /* float-long arithemetic */ + /* float-long arithmetic */ {NB_ADD, float_compactlong_guard, float_compactlong_add}, {NB_SUBTRACT, float_compactlong_guard, float_compactlong_subtract}, {NB_TRUE_DIVIDE, nonzero_float_compactlong_guard, float_compactlong_true_div}, diff --git a/Tools/build/generate-build-details.py b/Tools/build/generate-build-details.py index 8cd23e2f54f529..55fc5cfac93735 100644 --- a/Tools/build/generate-build-details.py +++ b/Tools/build/generate-build-details.py @@ -155,7 +155,7 @@ def make_paths_relative(data: dict[str, Any], config_path: str | None = None) -> continue # Get the relative path new_path = os.path.relpath(current_path, data['base_prefix']) - # Join '.' so that the path is formated as './path' instead of 'path' + # Join '.' so that the path is formatted as './path' instead of 'path' new_path = os.path.join('.', new_path) container[child] = new_path diff --git a/Tools/cases_generator/tier1_generator.py b/Tools/cases_generator/tier1_generator.py index 32dc346d5e891a..7cd95ed9b32691 100644 --- a/Tools/cases_generator/tier1_generator.py +++ b/Tools/cases_generator/tier1_generator.py @@ -201,7 +201,7 @@ def generate_tier1_labels( analysis: Analysis, emitter: Emitter ) -> None: emitter.emit("\n") - # Emit tail-callable labels as function defintions + # Emit tail-callable labels as function definitions for name, label in analysis.labels.items(): emitter.emit(f"LABEL({name})\n") storage = Storage(Stack(), [], [], 0, False) diff --git a/Tools/peg_generator/pegen/grammar_visualizer.py b/Tools/peg_generator/pegen/grammar_visualizer.py index 11f784f45b66b8..0c48ce7bb7860a 100644 --- a/Tools/peg_generator/pegen/grammar_visualizer.py +++ b/Tools/peg_generator/pegen/grammar_visualizer.py @@ -33,15 +33,15 @@ def print_nodes_recursively(self, node: Rule, prefix: str = "", istail: bool = T value = self.name(node) line = prefix + ("└──" if istail else "├──") + value + "\n" - sufix = " " if istail else "│ " + suffix = " " if istail else "│ " if not children: return line *children, last = children for child in children: - line += self.print_nodes_recursively(child, prefix + sufix, False) - line += self.print_nodes_recursively(last, prefix + sufix, True) + line += self.print_nodes_recursively(child, prefix + suffix, False) + line += self.print_nodes_recursively(last, prefix + suffix, True) return line pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy