This is an archive of the discontinued Mercurial Phabricator instance.

typing: add type annotations to mercurial/i18n.py
ClosedPublic

Authored by mharbison72 on Mar 6 2021, 7:45 PM.

Details

Summary

I'm a little unsure of this because gettext() clearly allows for passing
unicode. But the comments seem to indicate that this is related to tests, and
this was useful for catching unicode being passed to _() in the keyring
extension. I'm also not sure why _(None) would make any sense, so maybe the
argument shouldn't be optional? I didn't add it to the lambda in plain mode
because that spilled beyond 80 characters and so black mangled it.

Black and pytype disagree on where the comment to disable a check needs to go,
so this has to disable and then enable the checking.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mharbison72 created this revision.Mar 6 2021, 7:45 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.