MCPcopy Index your code
hub / github.com/python/cpython / _TupleType

Class _TupleType

Lib/typing.py:1701–1712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1699
1700
1701class _TupleType(_SpecialGenericAlias, _root=True):
1702 @_tp_cache
1703 def __getitem__(self, params):
1704 if not isinstance(params, tuple):
1705 params = (params,)
1706 if len(params) >= 2 and params[-1] is ...:
1707 msg = "Tuple[t, ...]: t must be a type."
1708 params = tuple(_type_check(p, msg) for p in params[:-1])
1709 return self.copy_with((*params, _TypingEllipsis))
1710 msg = "Tuple[t0, t1, ...]: each t must be a type."
1711 params = tuple(_type_check(p, msg) for p in params)
1712 return self.copy_with(params)
1713
1714
1715class _UnionGenericAliasMeta(type):

Callers 1

typing.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…