This is an archive of the discontinued Mercurial Phabricator instance.

cmdutil: add a pytype annotation to help out some callsites
ClosedPublic

Authored by durin42 on Nov 13 2019, 10:51 PM.

Details

Summary

I think we could constrain the values here more than Any, but this
lets us move forward with typechecking commands.py.

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

durin42 created this revision.Nov 13 2019, 10:51 PM
dlax added a subscriber: dlax.Nov 14 2019, 4:12 AM
dlax added inline comments.
mercurial/cmdutil.py
3971

Wouldn't -> Dict[bytes, List[bytes]] be okay? (Not sure why "Any" you're referering to in commit message, though I understand Dict[bytes, Any] comes from state.cmdstate.read() return type in D7383.)

dlax accepted this revision.Nov 14 2019, 4:12 AM
durin42 marked an inline comment as done.Nov 14 2019, 4:15 PM
durin42 added inline comments.
mercurial/cmdutil.py
3971

I'm pretty sure that some of the dict values are booleans at the very least?

dlax accepted this revision.Nov 15 2019, 6:07 AM
indygreg accepted this revision.Nov 18 2019, 10:43 PM
This revision is now accepted and ready to land.Nov 18 2019, 10:43 PM
durin42 marked an inline comment as done.Nov 18 2019, 10:49 PM
This revision was automatically updated to reflect the committed changes.