mercurial/pycompat.py
changeset 48029 1fda8c9358ce
parent 47852 2b76255a4f74
child 48298 6ffcaba7d122
--- a/mercurial/pycompat.py	Mon Sep 20 15:51:23 2021 -0400
+++ b/mercurial/pycompat.py	Tue Sep 21 00:16:35 2021 -0400
@@ -222,6 +222,15 @@
         >>> assert type(t) is bytes
         """
 
+        # Trick pytype into not demanding Iterable[int] be passed to __new__(),
+        # since the appropriate bytes format is done internally.
+        #
+        # https://github.com/google/pytype/issues/500
+        if TYPE_CHECKING:
+
+            def __init__(self, s=b''):
+                pass
+
         def __new__(cls, s=b''):
             if isinstance(s, bytestr):
                 return s