Thu, 15 Dec 2022 01:05:27 -0500 typing: add type hints to most mercurial/pycompat.py functions
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Dec 2022 01:05:27 -0500] rev 49807
typing: add type hints to most mercurial/pycompat.py functions The `rapply` methods are left out because it's not `rapply(f, xs: _T0) -> _T0` as I first thought- it's used somewhere to walk a collection and convert between bytes and str. Also, the `open()` call is partially untyped because I'm not sure what its purpose is at this point- both the name and mode can be either bytes or str as it is currently constituted. It might make sense to assert that the file is being opened in binary mode (like `namedtempfile()`) and cast the result to `BinaryIO`, but that shouldn't be smuggled in with these other changes. The return is currently typed as `Any` because something suddenly got smarter and a few uses in util.py (like readfile()) suddenly think it returns `IO[str]` instead of `IO[bytes]` (BinaryIO), and it flags the type mismatch there.
Wed, 14 Dec 2022 22:27:22 -0500 statprof: don't pass str `sys.argv` to a function expecting bytes
Matt Harbison <matt_harbison@yahoo.com> [Wed, 14 Dec 2022 22:27:22 -0500] rev 49806
statprof: don't pass str `sys.argv` to a function expecting bytes Found by typing the global functions in mercurial.pycompat.
Wed, 14 Dec 2022 22:24:54 -0500 typing: drop an unnecessary warning disabling comment in match.py
Matt Harbison <matt_harbison@yahoo.com> [Wed, 14 Dec 2022 22:24:54 -0500] rev 49805
typing: drop an unnecessary warning disabling comment in match.py This stopped being necessary in d2e1dcd4490d, when the exception stopped being subscripted.
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -3 +3 +10 +30 +100 +300 +1000 tip