From a1d1870779bd9cc539987663408f145d884a5e6b Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Tue, 26 Mar 2019 23:25:15 -0700 Subject: [PATCH] Fix a py2 parameter type in string.Template.(safe_)substitute. (#2888) Context: https://github.com/python/typeshed/pull/2871#issuecomment-476806895 --- stdlib/2/string.pyi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/2/string.pyi b/stdlib/2/string.pyi index fc06f1a0c..ecdf23fc1 100644 --- a/stdlib/2/string.pyi +++ b/stdlib/2/string.pyi @@ -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):