(cls, origin, args)
| 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]): |
no test coverage detected