mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Improve trait signature in mypy_extensions.pyi (#7027)
Co-authored-by: Mehdi Drissi <mdrissi@snapchat.com>
This commit is contained in:
@@ -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]): ...
|
||||
|
||||
Reference in New Issue
Block a user