Skip to content

Improve TypeVar stub #4150

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 2 commits into from
May 31, 2020
Merged
Show file tree
Hide file tree
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
10 changes: 9 additions & 1 deletion stdlib/2/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ import collections # Needed by aliases like DefaultDict, see mypy issue 2986

overload = object()
Any = object()
TypeVar = object()

class TypeVar:
__name__: str
__bound__: Optional[Type[Any]]
__constraints__: Tuple[Type[Any], ...]
__covariant__: bool
__contravariant__: bool
def __init__(self, name: str, *constraints: Type[Any], bound: Optional[Type[Any]] = ..., covariant: bool = ..., contravariant: bool = ...) -> None: ...

_promote = object()

class _SpecialForm(object):
Expand Down
10 changes: 9 additions & 1 deletion stdlib/3/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ import collections # Needed by aliases like DefaultDict, see mypy issue 2986

overload = object()
Any = object()
TypeVar = object()

class TypeVar:
__name__: str
__bound__: Optional[Type[Any]]
__constraints__: Tuple[Type[Any], ...]
__covariant__: bool
__contravariant__: bool
def __init__(self, name: str, *constraints: Type[Any], bound: Optional[Type[Any]] = ..., covariant: bool = ..., contravariant: bool = ...) -> None: ...

_promote = object()

class _SpecialForm:
Expand Down