Fix a py2 parameter type in string.Template.(safe_)substitute. (#2888)

Context: https://github.com/python/typeshed/pull/2871#issuecomment-476806895
This commit is contained in:
Rebecca Chen
2019-03-26 23:25:15 -07:00
committed by GitHub
parent c526975a1b
commit a1d1870779

View File

@@ -52,13 +52,13 @@ class Template:
def __init__(self, template: Text) -> None: ...
@overload
def substitute(self, mapping: Mapping[Text, str] = ..., **kwds: str) -> str: ...
def substitute(self, mapping: Union[Mapping[str, str], Mapping[unicode, str]] = ..., **kwds: str) -> str: ...
@overload
def substitute(self, mapping: Mapping[Text, Text] = ..., **kwds: Text) -> Text: ...
def substitute(self, mapping: Union[Mapping[str, Text], Mapping[unicode, Text]] = ..., **kwds: Text) -> Text: ...
@overload
def safe_substitute(self, mapping: Mapping[Text, str] = ..., **kwds: str) -> str: ...
def safe_substitute(self, mapping: Union[Mapping[str, str], Mapping[unicode, str]] = ..., **kwds: str) -> str: ...
@overload
def safe_substitute(self, mapping: Mapping[Text, Text] = ..., **kwds: Text) -> Text: ...
def safe_substitute(self, mapping: Union[Mapping[str, Text], Mapping[unicode, Text]], **kwds: Text) -> Text: ...
# TODO(MichalPokorny): This is probably badly and/or loosely typed.
class Formatter(object):