diff mercurial/bundle2.py @ 52709:279e217d6041

typing: lock in the new type annotations detected with the pyupgrade changes After the changes culminating in 70a75d379daf, pytype was able to detect these types better (typically changing from something like `Generator[Any, Any, None]` to `Generator[bytes, Any, None]`). Let's make these explicit so they don't disappear because of other changes.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 06 Jan 2025 20:02:17 -0500
parents 4cb75772818d
children e02c36478284
line wrap: on
line diff
--- a/mercurial/bundle2.py	Wed Jan 15 06:56:44 2025 +0100
+++ b/mercurial/bundle2.py	Mon Jan 06 20:02:17 2025 -0500
@@ -186,6 +186,7 @@
 if typing.TYPE_CHECKING:
     from typing import (
         Dict,
+        Iterator,
         List,
         Optional,
         Tuple,
@@ -739,7 +740,7 @@
         return part
 
     # methods used to generate the bundle2 stream
-    def getchunks(self):
+    def getchunks(self) -> Iterator[bytes]:
         if self.ui.debugflag:
             msg = [b'bundle2-output-bundle: "%s",' % self._magicstring]
             if self._params: