Skip to content

Make Python 2's inspect more tolerant of unicode #3847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions stdlib/2/inspect.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from types import CodeType, TracebackType, FrameType, FunctionType, MethodType, ModuleType
from typing import Any, Dict, Callable, List, NamedTuple, Optional, Sequence, Tuple, Type, Union
from typing import Any, Dict, Callable, List, NamedTuple, Optional, Sequence, Tuple, Type, Union, AnyStr

# Types and members
class EndOfBlock(Exception): ...
Expand All @@ -10,8 +10,8 @@ class BlockFinder:
started: bool
passline: bool
last: int
def tokeneater(self, type: int, token: str, srow_scol: Tuple[int, int],
erow_ecol: Tuple[int, int], line: str) -> None: ...
def tokeneater(self, type: int, token: AnyStr, srow_scol: Tuple[int, int],
erow_ecol: Tuple[int, int], line: AnyStr) -> None: ...

CO_GENERATOR: int
CO_NESTED: int
Expand All @@ -32,8 +32,8 @@ def getmembers(
object: object,
predicate: Optional[Callable[[Any], bool]] = ...
) -> List[Tuple[str, Any]]: ...
def getmoduleinfo(path: str) -> Optional[ModuleInfo]: ...
def getmodulename(path: str) -> Optional[str]: ...
def getmoduleinfo(path: Union[str, unicode]) -> Optional[ModuleInfo]: ...
def getmodulename(path: AnyStr) -> Optional[AnyStr]: ...

def ismodule(object: object) -> bool: ...
def isclass(object: object) -> bool: ...
Expand All @@ -57,16 +57,16 @@ _SourceObjectType = Union[ModuleType, Type[Any], MethodType, FunctionType, Trace

def findsource(object: _SourceObjectType) -> Tuple[List[str], int]: ...
def getabsfile(object: _SourceObjectType) -> str: ...
def getblock(lines: Sequence[str]) -> Sequence[str]: ...
def getblock(lines: Sequence[AnyStr]) -> Sequence[AnyStr]: ...
def getdoc(object: object) -> Optional[str]: ...
def getcomments(object: object) -> Optional[str]: ...
def getfile(object: _SourceObjectType) -> str: ...
def getmodule(object: object) -> Optional[ModuleType]: ...
def getsourcefile(object: _SourceObjectType) -> Optional[str]: ...
def getsourcelines(object: _SourceObjectType) -> Tuple[List[str], int]: ...
def getsource(object: _SourceObjectType) -> str: ...
def cleandoc(doc: str) -> str: ...
def indentsize(line: str) -> int: ...
def cleandoc(doc: AnyStr) -> AnyStr: ...
def indentsize(line: Union[str, unicode]) -> int: ...

# Classes and functions
def getclasstree(classes: List[type], unique: bool = ...) -> List[Union[Tuple[type, Tuple[type, ...]], List[Any]]]: ...
Expand Down