Skip to content

Make all single-constraint TypeVars use bound= insteads (plus hack). #1118

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 29, 2017
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
2 changes: 1 addition & 1 deletion stdlib/2and3/plistlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ from enum import Enum
import sys

mm = MutableMapping[str, Any]
_D = TypeVar('_D', mm)
_D = TypeVar('_D', bound=mm)
if sys.version_info >= (3,):
_Path = str
else:
Expand Down
9 changes: 5 additions & 4 deletions stdlib/3/unittest/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ from contextlib import ContextManager


_T = TypeVar('_T')
_FT = TypeVar('_FT', Callable[[Any], Any])
_FT = TypeVar('_FT', bound=Callable[[Any], Any])
_E = TypeVar('_E', bound=Exception)


def skip(reason: str) -> Callable[[_FT], _FT]: ...
def skipIf(condition: object, reason: str) -> Callable[[_FT], _FT]: ...
def skipUnless(condition: object, reason: str) -> Callable[[_FT], _FT]: ...
def expectedFailure(func: _FT) -> _FT: ...
# TODO: Once python/mypy#1551 is fixed, the following need _FT instead of Any
def skip(reason: str) -> Callable[[Any], Any]: ...
def skipIf(condition: object, reason: str) -> Callable[[Any], Any]: ...
def skipUnless(condition: object, reason: str) -> Callable[[Any], Any]: ...

class SkipTest(Exception):
def __init__(self, reason: str) -> None: ...
Expand Down