]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] remove type annotations from multiprocessing. (GH-129381) (#129470)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 30 Jan 2025 08:54:15 +0000 (09:54 +0100)
committerGitHub <noreply@github.com>
Thu, 30 Jan 2025 08:54:15 +0000 (08:54 +0000)
remove type annotations from multiprocessing. (GH-129381)

* remove type annotations from multiprocessing.

One of them was technically invalid per typing specs... but since we're not
checking these in the stdlib today lets elide them.

https://discuss.python.org/t/static-type-annotations-in-cpython/65068/13

* use the actual comment style annotation format

---------
(cherry picked from commit 71aecc284efdf997939568a4167dbffe1a65b9bf)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Lib/multiprocessing/connection.py
Lib/multiprocessing/synchronize.py

index c48e556294738f5a6d38bec55b0555dd3bc6d493..8caddd204d7c98fb1b09ddf4075f1c45f7d50019 100644 (file)
@@ -846,7 +846,7 @@ _MD5_DIGEST_LEN = 16
 _LEGACY_LENGTHS = (_MD5ONLY_MESSAGE_LENGTH, _MD5_DIGEST_LEN)
 
 
-def _get_digest_name_and_payload(message: bytes) -> (str, bytes):
+def _get_digest_name_and_payload(message):  # type: (bytes) -> tuple[str, bytes]
     """Returns a digest name and the payload for a response hash.
 
     If a legacy protocol is detected based on the message length
index 0f682b9a0944b811bbb26f0176c3d208d2610efd..870c91349b9164f533864244d84f6328ab9beed1 100644 (file)
@@ -360,7 +360,7 @@ class Event(object):
                 return True
             return False
 
-    def __repr__(self) -> str:
+    def __repr__(self):
         set_status = 'set' if self.is_set() else 'unset'
         return f"<{type(self).__qualname__} at {id(self):#x} {set_status}>"
 #