Page MenuHomePhabricator

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

Authored by durin42 on Wed, Nov 13, 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.Wed, Nov 13, 10:51 PM
dlax added a subscriber: dlax.Thu, Nov 14, 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.Thu, Nov 14, 4:12 AM
durin42 marked an inline comment as done.Thu, Nov 14, 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.Fri, Nov 15, 6:07 AM
indygreg accepted this revision.Mon, Nov 18, 10:43 PM
This revision is now accepted and ready to land.Mon, Nov 18, 10:43 PM
durin42 marked an inline comment as done.Mon, Nov 18, 10:49 PM
This revision was automatically updated to reflect the committed changes.