diff --git a/stdlib/2/pydoc.pyi b/stdlib/2and3/pydoc.pyi similarity index 96% rename from stdlib/2/pydoc.pyi rename to stdlib/2and3/pydoc.pyi index 41505e6b2..eeb929e4f 100644 --- a/stdlib/2/pydoc.pyi +++ b/stdlib/2and3/pydoc.pyi @@ -1,7 +1,11 @@ -from typing import Any, AnyStr, Callable, Container, Dict, IO, List, Mapping, MutableMapping, NoReturn, Optional, Tuple, Type, Union -from repr import Repr - +import sys +from typing import Any, AnyStr, Callable, Container, Dict, IO, List, Mapping, MutableMapping, NoReturn, Optional, Text, Tuple, Type, Union from types import FunctionType, MethodType, ModuleType, TracebackType +if sys.version_info >= (3,): + from reprlib import Repr +else: + from repr import Repr + # the return type of sys.exc_info(), used by ErrorDuringImport.__init__ _Exc_Info = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] @@ -11,7 +15,7 @@ __version__ = ... # type: str __credits__ = ... # type: str def pathdirs() -> List[str]: ... -def getdoc(object: object) -> Union[str, unicode]: ... +def getdoc(object: object) -> Text: ... def splitdoc(doc: AnyStr) -> Tuple[AnyStr, AnyStr]: ... def classname(object: object, modname: str) -> str: ... def isdata(object: object) -> bool: ... @@ -57,8 +61,8 @@ class HTMLRepr(Repr): def escape(self, text: str) -> str: ... def repr(self, object: object) -> str: ... def repr1(self, x: object, level: complex) -> str: ... - def repr_string(self, x: Union[str, unicode], level: complex) -> str: ... - def repr_str(self, x: Union[str, unicode], level: complex) -> str: ... + def repr_string(self, x: Text, level: complex) -> str: ... + def repr_str(self, x: Text, level: complex) -> str: ... def repr_instance(self, x: object, level: complex) -> str: ... def repr_unicode(self, x: AnyStr, level: complex) -> str: ...