callable(args, a1, ..., an, r) constructs a callable with argument types a1, ... an and return type r and type arguments vars.
(self, vars: list[str], *a: Type)
| 665 | return TupleType(list(a), self.fx.std_tuple) |
| 666 | |
| 667 | def callable(self, vars: list[str], *a: Type) -> CallableType: |
| 668 | """callable(args, a1, ..., an, r) constructs a callable with |
| 669 | argument types a1, ... an and return type r and type arguments |
| 670 | vars. |
| 671 | """ |
| 672 | tv: list[TypeVarType] = [] |
| 673 | n = -1 |
| 674 | for v in vars: |
| 675 | tv.append( |
| 676 | TypeVarType( |
| 677 | v, v, TypeVarId(n), [], self.fx.o, AnyType(TypeOfAny.from_omitted_generics) |
| 678 | ) |
| 679 | ) |
| 680 | n -= 1 |
| 681 | return CallableType( |
| 682 | list(a[:-1]), |
| 683 | [ARG_POS] * (len(a) - 1), |
| 684 | [None] * (len(a) - 1), |
| 685 | a[-1], |
| 686 | self.fx.function, |
| 687 | name=None, |
| 688 | variables=tv, |
| 689 | ) |
| 690 | |
| 691 | |
| 692 | class JoinSuite(Suite): |
no test coverage detected