(self, typ: Type)
| 666 | assert False, f"This should be never called, got {t}" |
| 667 | |
| 668 | def default(self, typ: Type) -> ProperType: |
| 669 | typ = get_proper_type(typ) |
| 670 | if isinstance(typ, Instance): |
| 671 | return object_from_instance(typ) |
| 672 | elif isinstance(typ, TypeType): |
| 673 | return self.default(typ.item) |
| 674 | elif isinstance(typ, UnboundType): |
| 675 | return AnyType(TypeOfAny.special_form) |
| 676 | elif isinstance(typ, TupleType): |
| 677 | return self.default(mypy.typeops.tuple_fallback(typ)) |
| 678 | elif isinstance(typ, TypedDictType): |
| 679 | return self.default(typ.fallback) |
| 680 | elif isinstance(typ, FunctionLike): |
| 681 | return self.default(typ.fallback) |
| 682 | elif isinstance(typ, TypeVarType): |
| 683 | return self.default(typ.upper_bound) |
| 684 | elif isinstance(typ, ParamSpecType): |
| 685 | return self.default(typ.upper_bound) |
| 686 | else: |
| 687 | return AnyType(TypeOfAny.special_form) |
| 688 | |
| 689 | |
| 690 | def is_better(t: Type, s: Type) -> bool: |
no test coverage detected