mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Make all single-constraint TypeVars use bound= insteads (plus hack) (#1118)
Another attempt for #804, to unblock python/mypy#2626. There's a work-around here for python/mypy#1551.
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user