(self, typ: ProperType)
| 769 | return False |
| 770 | |
| 771 | def can_match_sequence(self, typ: ProperType) -> bool: |
| 772 | if isinstance(typ, AnyType): |
| 773 | return True |
| 774 | if isinstance(typ, UnionType): |
| 775 | return any(self.can_match_sequence(get_proper_type(item)) for item in typ.items) |
| 776 | for other in self.non_sequence_match_types: |
| 777 | # We have to ignore promotions, as memoryview should match, but bytes, |
| 778 | # which it can be promoted to, shouldn't |
| 779 | if is_subtype(typ, other, ignore_promotions=True): |
| 780 | return False |
| 781 | sequence = self.chk.named_type("typing.Sequence") |
| 782 | # If the static type is more general than sequence the actual type could still match |
| 783 | return is_subtype(typ, sequence) or is_subtype(sequence, typ) |
| 784 | |
| 785 | def generate_types_from_names(self, type_names: list[str]) -> list[Type]: |
| 786 | types: list[Type] = [] |
no test coverage detected