We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 810504d commit 02eac70Copy full SHA for 02eac70
mypy/plugins/enums.py
@@ -17,6 +17,7 @@
17
from typing import Final, TypeVar, cast
18
19
import mypy.plugin # To avoid circular imports.
20
+from mypy.checker import TypeChecker
21
from mypy.nodes import TypeInfo, Var
22
from mypy.semanal_enum import ENUM_BASES
23
from mypy.subtypes import is_equivalent
@@ -129,6 +130,7 @@ def _infer_value_type_with_auto_fallback(
129
130
131
132
def _is_defined_in_stub(ctx: mypy.plugin.AttributeContext) -> bool:
133
+ assert isinstance(ctx.api, TypeChecker)
134
return (
135
isinstance(ctx.type, Instance)
136
and ctx.api.modules[ctx.type.type.fullname.rsplit(".", 1)[0]].is_stub
0 commit comments