Fix type annotations for utils.parse.keyvalue

This commit is contained in:
jesopo 2018-11-11 14:43:31 +00:00
parent 6bb03c4519
commit 0f53d2e828

View file

@ -56,8 +56,9 @@ def docstring(s: str) -> Docstring:
description += line
return Docstring(description, items, var_items)
def keyvalue(s, delimiter: str=" ") -> typing.Dict[str, str]:
items = {}
def keyvalue(s: str, delimiter: str=" "
) -> typing.Dict[str, typing.Optional[str]]:
items = {} # type: typing.Dict[str, typing.Optional[str]]
pairs = s.split(delimiter)
for pair in filter(None, pairs):
key, sep, value = pair.partition("=")