]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
remove type annotations from multiprocessing. (#129381)
authorGregory P. Smith <greg@krypto.org>
Thu, 30 Jan 2025 08:31:54 +0000 (00:31 -0800)
committerGitHub <noreply@github.com>
Thu, 30 Jan 2025 08:31:54 +0000 (00:31 -0800)
* 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

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
---------

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

index 710aba9685efda554351a1dcd419d5e20b1165b8..d429212d4473805601812498f3003e8ba698ab1c 100644 (file)
@@ -853,7 +853,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 4f72373c951abc5a3c1156801198c5b08f376e68..edd6c2543a74352c2baf4c9100877b90e5029266 100644 (file)
@@ -359,7 +359,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}>"
 #