(self, defn: ClassDef, base: TupleType)
| 2701 | self.calculate_class_mro(defn, self.object_type) |
| 2702 | |
| 2703 | def configure_tuple_base_class(self, defn: ClassDef, base: TupleType) -> Instance: |
| 2704 | info = defn.info |
| 2705 | |
| 2706 | # There may be an existing valid tuple type from previous semanal iterations. |
| 2707 | # Use equality to check if it is the case. |
| 2708 | if info.tuple_type and info.tuple_type != base and not has_placeholder(info.tuple_type): |
| 2709 | self.fail("Class has two incompatible bases derived from tuple", defn) |
| 2710 | defn.has_incompatible_baseclass = True |
| 2711 | if has_placeholder(base): |
| 2712 | self.process_placeholder( |
| 2713 | None, "tuple base", defn, force_progress=base != info.tuple_type |
| 2714 | ) |
| 2715 | info.update_tuple_type(base) |
| 2716 | self.setup_alias_type_vars(defn) |
| 2717 | |
| 2718 | if base.partial_fallback.type.fullname == "builtins.tuple" and not has_placeholder(base): |
| 2719 | # Fallback can only be safely calculated after semantic analysis, since base |
| 2720 | # classes may be incomplete. Postpone the calculation. |
| 2721 | self.schedule_patch(PRIORITY_FALLBACKS, lambda: calculate_tuple_fallback(base)) |
| 2722 | |
| 2723 | return base.partial_fallback |
| 2724 | |
| 2725 | def set_dummy_mro(self, info: TypeInfo) -> None: |
| 2726 | # Give it an MRO consisting of just the class itself and object. |
no test coverage detected