D7380: encoding: define per-use identity functions only in typechecking mode

Yuya Nishihara yuya at tcha.org
Thu Nov 14 09:29:20 EST 2019


>     strtolocal = pycompat.identity  # type: (str) -> bytes
>     strfromlocal = pycompat.identity  # type: (bytes) -> str

`# type: Callable[[str], bytes]` might work. pytype complained
`# type: ... -> ...` is an invalid type comment.


More information about the Mercurial-devel mailing list