changeset 43702:127d46468a45

state: add a pytype annotation Differential Revision: https://phab.mercurial-scm.org/D7383
author Augie Fackler <augie@google.com>
date Wed, 13 Nov 2019 22:22:49 -0500
parents c9301ac73b95
children a9b14ef701d1
files mercurial/state.py
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/state.py	Wed Nov 13 22:22:31 2019 -0500
+++ b/mercurial/state.py	Wed Nov 13 22:22:49 2019 -0500
@@ -27,6 +27,15 @@
 )
 from .utils import cborutil
 
+if not globals():
+    from typing import (
+        Any,
+        Dict,
+    )
+
+    for t in (Any, Dict):
+        assert t
+
 
 class cmdstate(object):
     """a wrapper class to store the state of commands like `rebase`, `graft`,
@@ -50,6 +59,7 @@
         self.fname = fname
 
     def read(self):
+        # type: () -> Dict[bytes, Any]
         """read the existing state file and return a dict of data stored"""
         return self._read()