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

Method __new__

Lib/_collections_abc.py:473–483  ·  view source on GitHub ↗
(cls, origin, args)

Source from the content-addressed store, hash-verified

471 __slots__ = ()
472
473 def __new__(cls, origin, args):
474 if not (isinstance(args, tuple) and len(args) == 2):
475 raise TypeError(
476 "Callable must be used as Callable[[arg, ...], result].")
477 t_args, t_result = args
478 if isinstance(t_args, (tuple, list)):
479 args = (*t_args, t_result)
480 elif not _is_param_expr(t_args):
481 raise TypeError(f"Expected a list of types, an ellipsis, "
482 f"ParamSpec, or Concatenate. Got {t_args}")
483 return super().__new__(cls, origin, args)
484
485 def __repr__(self):
486 if len(self.__args__) == 2 and _is_param_expr(self.__args__[0]):

Callers 1

__new__Method · 0.45

Calls 2

superClass · 0.85
_is_param_exprFunction · 0.70

Tested by

no test coverage detected