mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Add __class_getitem__ to builtins generified in PEP 585 (#4184)
* Add __class_getitem__ to builtins generified in PEP 585 * Declare types.GenericAlias and use it in __class_getitem__
This commit is contained in:
@@ -286,3 +286,11 @@ def prepare_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any]
|
||||
DynamicClassAttribute = property
|
||||
|
||||
def coroutine(f: Callable[..., Any]) -> CoroutineType: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
class GenericAlias:
|
||||
__origin__: type
|
||||
__args__: Tuple[Any, ...]
|
||||
__parameters__: Tuple[Any, ...]
|
||||
def __init__(self, origin: type, args: Any): ...
|
||||
def __getattr__(self, name: str) -> Any: ... # incomplete
|
||||
|
||||
Reference in New Issue
Block a user