From 7cc6b559be40e3aa82d99a828951a272f03b0dff Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 5 Nov 2018 11:56:52 +0000 Subject: [PATCH] Clarify `items` and `var_items` typing in src.utils.parse --- src/utils/parse.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/parse.py b/src/utils/parse.py index 4fa3bb79..e3d3d52b 100644 --- a/src/utils/parse.py +++ b/src/utils/parse.py @@ -21,7 +21,8 @@ def hashflags(filename: str) -> typing.List[typing.Tuple[str, str]]: return list(hashflags.items()) class Docstring(object): - def __init__(self, description: str, items: dict, var_items: dict): + def __init__(self, description: str, items: typing.Dict[str, str], + var_items: typing.Dict[str, typing.List[str]]): self.description = description self.items = items self.var_items = var_items @@ -29,8 +30,8 @@ class Docstring(object): def docstring(s: str) -> Docstring: description = "" last_item = None - items = {} - var_items = {} + items = {} # type: typing.Dict[str, str] + var_items = {} # type: typing.Dict[str, typing.List[str]] if s: for line in s.split("\n"): line = line.strip()