Fix type annotations for utils.parse.keyvalue
This commit is contained in:
parent
6bb03c4519
commit
0f53d2e828
1 changed files with 3 additions and 2 deletions
|
@ -56,8 +56,9 @@ def docstring(s: str) -> Docstring:
|
||||||
description += line
|
description += line
|
||||||
return Docstring(description, items, var_items)
|
return Docstring(description, items, var_items)
|
||||||
|
|
||||||
def keyvalue(s, delimiter: str=" ") -> typing.Dict[str, str]:
|
def keyvalue(s: str, delimiter: str=" "
|
||||||
items = {}
|
) -> typing.Dict[str, typing.Optional[str]]:
|
||||||
|
items = {} # type: typing.Dict[str, typing.Optional[str]]
|
||||||
pairs = s.split(delimiter)
|
pairs = s.split(delimiter)
|
||||||
for pair in filter(None, pairs):
|
for pair in filter(None, pairs):
|
||||||
key, sep, value = pair.partition("=")
|
key, sep, value = pair.partition("=")
|
||||||
|
|
Loading…
Reference in a new issue