Improve trait signature in mypy_extensions.pyi (#7027)

Co-authored-by: Mehdi Drissi <mdrissi@snapchat.com>
This commit is contained in:
Mehdi Drissi
2022-01-25 04:03:54 -06:00
committed by GitHub
parent 20508d05f4
commit b8bea1b2c9

View File

@@ -38,9 +38,10 @@ def KwArg(type: _T = ...) -> _T: ...
# Deprecated: Use typing.NoReturn instead.
class NoReturn: ...
# This is intended as a class decorator, but mypy rejects abstract classes
# when a Type[_T] is expected, so we can't give it the type we want
def trait(cls: Any) -> Any: ...
# This is consistent with implementation. Usage intends for this as
# a class decorator, but mypy does not support type[_T] for abstract
# classes until this issue is resolved, https://github.com/python/mypy/issues/4717.
def trait(cls: _T) -> _T: ...
def mypyc_attr(*attrs: str, **kwattrs: object) -> Callable[[_T], _T]: ...
class FlexibleAlias(Generic[_T, _U]): ...