Patchwork D7383: state: add a pytype annotation

login
register
mail settings
Submitter phabricator
Date Nov. 14, 2019, 3:52 a.m.
Message ID <differential-rev-PHID-DREV-vrla3kljjijztayd7wta-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43176/
State Superseded
Headers show

Comments

phabricator - Nov. 14, 2019, 3:52 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7383

AFFECTED FILES
  mercurial/state.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/state.py b/mercurial/state.py
--- a/mercurial/state.py
+++ b/mercurial/state.py
@@ -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()