From ddb314f5989a2f5ee81505d7b80abd8087ee70df Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Thu, 30 Jan 2025 10:08:31 +0100 Subject: [PATCH] [3.12] remove type annotations from multiprocessing. (GH-129381) (#129471) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- Lib/multiprocessing/connection.py | 2 +- Lib/multiprocessing/synchronize.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py index fdbc3bda7db..81ed2ae51d1 100644 --- a/Lib/multiprocessing/connection.py +++ b/Lib/multiprocessing/connection.py @@ -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 diff --git a/Lib/multiprocessing/synchronize.py b/Lib/multiprocessing/synchronize.py index 0f682b9a094..870c91349b9 100644 --- a/Lib/multiprocessing/synchronize.py +++ b/Lib/multiprocessing/synchronize.py @@ -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}>" #