Clarify items and var_items typing in src.utils.parse

This commit is contained in:
jesopo 2018-11-05 11:56:52 +00:00
parent 9c233cd4dd
commit 7cc6b559be

View file

@ -21,7 +21,8 @@ def hashflags(filename: str) -> typing.List[typing.Tuple[str, str]]:
return list(hashflags.items()) return list(hashflags.items())
class Docstring(object): 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.description = description
self.items = items self.items = items
self.var_items = var_items self.var_items = var_items
@ -29,8 +30,8 @@ class Docstring(object):
def docstring(s: str) -> Docstring: def docstring(s: str) -> Docstring:
description = "" description = ""
last_item = None last_item = None
items = {} items = {} # type: typing.Dict[str, str]
var_items = {} var_items = {} # type: typing.Dict[str, typing.List[str]]
if s: if s:
for line in s.split("\n"): for line in s.split("\n"):
line = line.strip() line = line.strip()