Find out if `left` is a Tuple[A, ...], and adjust its length to `right`
(left: ProperType, r: ProperType)
| 765 | |
| 766 | |
| 767 | def adjust_tuple(left: ProperType, r: ProperType) -> TupleType | None: |
| 768 | """Find out if `left` is a Tuple[A, ...], and adjust its length to `right`""" |
| 769 | if isinstance(left, Instance) and left.type.fullname == "builtins.tuple": |
| 770 | n = r.length() if isinstance(r, TupleType) else 1 |
| 771 | return TupleType([left.args[0]] * n, left) |
| 772 | return None |
| 773 | |
| 774 | |
| 775 | def is_tuple(typ: Type) -> bool: |
no test coverage detected
searching dependent graphs…