MCPcopy Index your code
hub / github.com/RustPython/RustPython / _TupleType

Class _TupleType

Lib/typing.py:1665–1676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1663
1664
1665class _TupleType(_SpecialGenericAlias, _root=True):
1666 @_tp_cache
1667 def __getitem__(self, params):
1668 if not isinstance(params, tuple):
1669 params = (params,)
1670 if len(params) >= 2 and params[-1] is ...:
1671 msg = "Tuple[t, ...]: t must be a type."
1672 params = tuple(_type_check(p, msg) for p in params[:-1])
1673 return self.copy_with((*params, _TypingEllipsis))
1674 msg = "Tuple[t0, t1, ...]: each t must be a type."
1675 params = tuple(_type_check(p, msg) for p in params)
1676 return self.copy_with(params)
1677
1678
1679class _UnionGenericAliasMeta(type):

Callers 1

typing.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected