Mercurial > public > mercurial-scm > hg-stable
diff mercurial/i18n.py @ 51304: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 | 9d3721552b6c |
children | 8b2ea2246a5f |
line wrap: on
line diff
--- a/mercurial/i18n.py Wed Dec 20 20:13:22 2023 +0100 +++ b/mercurial/i18n.py Tue Dec 19 21:29:34 2023 +0100 @@ -71,8 +71,7 @@ _msgcache = {} # encoding: {message: translation} -def gettext(message): - # type: (bytes) -> bytes +def gettext(message: bytes) -> bytes: """Translate message. The message is looked up in the catalog to get a Unicode string, @@ -123,6 +122,10 @@ if _plain(): - _ = lambda message: message # type: Callable[[bytes], bytes] + + def _(message: bytes) -> bytes: + return message + + else: _ = gettext