diff -r b642a6298ce0 -r 1fda8c9358ce mercurial/pycompat.py --- 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