|
127 | 127 | 'builtins.bytearray': 'builtins.str', |
128 | 128 | }) |
129 | 129 |
|
130 | | -# Hard coded list of Enum baseclasses. |
131 | | -ENUM_BASECLASSES = [ |
132 | | - 'enum.Enum', |
133 | | - 'enum.IntEnum', |
134 | | -] |
135 | | - |
136 | 130 | # When analyzing a function, should we analyze the whole function in one go, or |
137 | 131 | # should we only perform one phase of the analysis? The latter is used for |
138 | 132 | # nested functions. In the first phase we add the function to the symbol table |
@@ -765,8 +759,6 @@ def analyze_base_classes(self, defn: ClassDef) -> None: |
765 | 759 | defn.info.fallback_to_any = True |
766 | 760 | elif not isinstance(base, UnboundType): |
767 | 761 | self.fail('Invalid base class', base_expr) |
768 | | - if isinstance(base, Instance): |
769 | | - defn.info.is_enum = self.decide_is_enum(base) |
770 | 762 | # Add 'object' as implicit base if there is no other base class. |
771 | 763 | if (not defn.base_types and defn.fullname != 'builtins.object'): |
772 | 764 | obj = self.object_type() |
@@ -830,11 +822,6 @@ def is_base_class(self, t: TypeInfo, s: TypeInfo) -> bool: |
830 | 822 | visited.add(base.type) |
831 | 823 | return False |
832 | 824 |
|
833 | | - def decide_is_enum(self, instance: Instance) -> bool: |
834 | | - """Decide if a TypeInfo should be marked as .is_enum=True""" |
835 | | - fullname = instance.type.fullname() |
836 | | - return fullname in ENUM_BASECLASSES |
837 | | - |
838 | 825 | def analyze_metaclass(self, defn: ClassDef) -> None: |
839 | 826 | if defn.metaclass: |
840 | 827 | sym = self.lookup_qualified(defn.metaclass, defn) |
|
0 commit comments