class documentation

class _GenericAlias:

View In Hierarchy

A python-based backport of the types.GenericAlias class.

E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).

See Also

PEP 585
The PEP responsible for introducing types.GenericAlias.
Method __dir__ Implement dir(self).
Method __eq__ Return self == value.
Method __getattribute__ Return getattr(self, name).
Method __getitem__ Return self[key].
Method __hash__ Return hash(self).
Method __init__ Undocumented
Method __instancecheck__ Check if an obj is an instance.
Method __mro​_entries__ Undocumented
Method __reduce__ Undocumented
Method __repr__ Return repr(self).
Method __subclasscheck__ Check if a cls is a subclass.
Constant ​_ATTR​_EXCEPTIONS Undocumented
Class Variable __slots__ Undocumented
Instance Variable ​_args Undocumented
Instance Variable ​_hash Undocumented
Instance Variable ​_origin Undocumented
Instance Variable ​_parameters Undocumented
Property __args__ Undocumented
Property __call__ Undocumented
Property __origin__ Undocumented
Property __parameters__ Type variables in the GenericAlias.
def __dir__(self):
Implement dir(self).
Returns
List[str]Undocumented
def __eq__(self, value):
Return self == value.
Parameters
value:objectUndocumented
Returns
boolUndocumented
def __getattribute__(self, name):
Return getattr(self, name).
Parameters
name:strUndocumented
Returns
AnyUndocumented
def __getitem__(self, key):
Return self[key].
Parameters
key:object|Tuple[object, ...]Undocumented
Returns
_TUndocumented
def __hash__(self):
Return hash(self).
Returns
intUndocumented
def __init__(self, origin, args):

Undocumented

Parameters
origin:typeUndocumented
args:object|Tuple[object, ...]Undocumented
def __instancecheck__(self, obj):
Check if an obj is an instance.
Parameters
obj:objectUndocumented
Returns
NoReturnUndocumented
def __mro_entries__(self, bases):

Undocumented

Parameters
bases:Iterable[object]Undocumented
Returns
Tuple[type]Undocumented
def __reduce__(self):

Undocumented

Returns
Tuple[Type[_T], Tuple[type, Tuple[object, ...]]]Undocumented
def __repr__(self):
Return repr(self).
Returns
strUndocumented
def __subclasscheck__(self, cls):
Check if a cls is a subclass.
Parameters
cls:typeUndocumented
Returns
NoReturnUndocumented
_ATTR_EXCEPTIONS: ClassVar[FrozenSet[str]] =

Undocumented

Value
frozenset(set(['__origin__',
               '__args__',
               '__parameters__',
               '__mro_entries__',
               '__reduce__',
               '__reduce_ex__',
               '__copy__',
...
__slots__: tuple[str, ...] =

Undocumented

_args =

Undocumented

_hash: int =

Undocumented

_origin =

Undocumented

_parameters =

Undocumented

@property
__args__: Tuple[object, ...] =

Undocumented

@property
__call__: type =

Undocumented

@property
__origin__: type =

Undocumented

@property
__parameters__: Tuple[TypeVar, ...] =
Type variables in the GenericAlias.