mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-07 04:34:29 +08:00
13 lines
348 B
Python
13 lines
348 B
Python
from mypy.nodes import TypeInfo
|
|
from mypy.plugin import ClassDefContext
|
|
|
|
|
|
def inject_any_as_base_for_nested_class_meta(ctx: ClassDefContext) -> None:
|
|
if 'Meta' not in ctx.cls.info.names:
|
|
return None
|
|
sym = ctx.cls.info.names['Meta']
|
|
if not isinstance(sym.node, TypeInfo):
|
|
return None
|
|
|
|
sym.node.fallback_to_any = True
|