comparison mercurial/pvec.py @ 51287:f15cb5111a1e

pytype: move some type comment to proper annotation We support direct type annotations now, while pytype is starting to complains about them.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 19 Dec 2023 21:29:34 +0100
parents d718eddf01d9
children f4733654f144
comparison
equal deleted inserted replaced
51286:81224afd938d 51287:f15cb5111a1e
70 for b in bs: 70 for b in bs:
71 v = v * 256 + ord(b) 71 v = v * 256 + ord(b)
72 return v 72 return v
73 73
74 74
75 def _str(v, l): 75 def _str(v: int, l: int) -> bytes:
76 # type: (int, int) -> bytes
77 bs = b"" 76 bs = b""
78 for p in range(l): 77 for p in range(l):
79 bs = pycompat.bytechr(v & 255) + bs 78 bs = pycompat.bytechr(v & 255) + bs
80 v >>= 8 79 v >>= 8
81 return bs 80 return bs