]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix typos in documentation and comments (GH-102374)
authorMichael K <michael-k@users.noreply.github.com>
Thu, 2 Mar 2023 15:26:49 +0000 (16:26 +0100)
committerGitHub <noreply@github.com>
Thu, 2 Mar 2023 15:26:49 +0000 (07:26 -0800)
Found some duplicate `to`s in the documentation and some code comments and fixed them.

[Misc/NEWS.d/3.12.0a1.rst](https://github.com/python/cpython/blob/ed55c69ebd74178115cd8b080f7f8e7588cd5fda/Misc/NEWS.d/3.12.0a1.rst) also contains two duplicate `to`s, but I wasn't sure if it's ok to touch that file.  Looks auto generated.  I'm happy to amend the PR if requested. :)

Automerge-Triggered-By: GH:AlexWaygood
Doc/library/sqlite3.rst
Doc/library/typing.rst
Lib/zoneinfo/_zoneinfo.py
Objects/typeobject.c

index 18d0a5e630f6a9bf14d4b55539759f7828e48ad9..ff036ad56acba81da59dffe61ba383218e04c3dc 100644 (file)
@@ -72,7 +72,7 @@ including `cursors`_ and `transactions`_.
 
 First, we need to create a new database and open
 a database connection to allow :mod:`!sqlite3` to work with it.
-Call :func:`sqlite3.connect` to to create a connection to
+Call :func:`sqlite3.connect` to create a connection to
 the database :file:`tutorial.db` in the current working directory,
 implicitly creating it if it does not exist:
 
index 3395e4bfb95c444b9ee7c2d05d385db19eed88c1..80a969e6335abe9ed145053030a2b583d2de83ed 100644 (file)
@@ -1345,7 +1345,7 @@ These are not used in annotations. They are building blocks for creating generic
 
         x: Ts          # Not valid
         x: tuple[Ts]   # Not valid
-        x: tuple[*Ts]  # The correct way to to do it
+        x: tuple[*Ts]  # The correct way to do it
 
     Type variable tuples can be used in the same contexts as normal type
     variables. For example, in class definitions, arguments, and return types::
index de68380792f17c329b02d9ace3a3d6739d5e9c2e..eede15b8271058a25500dcf6df26486caa554e44 100644 (file)
@@ -302,7 +302,7 @@ class ZoneInfo(tzinfo):
         # difference between utcoffset() and the "standard" offset, but
         # the "base offset" and "DST offset" are not encoded in the file;
         # we can infer what they are from the isdst flag, but it is not
-        # sufficient to to just look at the last standard offset, because
+        # sufficient to just look at the last standard offset, because
         # occasionally countries will shift both DST offset and base offset.
 
         typecnt = len(isdsts)
index b3f1429debc58b00c490312a9ba3b29262759fb1..54f1974c6ae3a7f86d79969331d31b959d52349b 100644 (file)
@@ -3822,11 +3822,11 @@ PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
 
     res->ht_qualname = Py_NewRef(ht_name);
     res->ht_name = ht_name;
-    ht_name = NULL;  // Give our reference to to the type
+    ht_name = NULL;  // Give our reference to the type
 
     type->tp_name = _ht_tpname;
     res->_ht_tpname = _ht_tpname;
-    _ht_tpname = NULL;  // Give ownership to to the type
+    _ht_tpname = NULL;  // Give ownership to the type
 
     /* Copy the sizes */