MCPcopy Index your code
hub / github.com/python/mypy / is_metaclass

Method is_metaclass

mypy/nodes.py:4089–4094  ·  view source on GitHub ↗
(self, *, precise: bool = False)

Source from the content-addressed store, hash-verified

4087 return None
4088
4089 def is_metaclass(self, *, precise: bool = False) -> bool:
4090 return (
4091 self.has_base("builtins.type")
4092 or self.fullname == "abc.ABCMeta"
4093 or (self.fallback_to_any and not precise)
4094 )
4095
4096 def has_base(self, fullname: str) -> bool:
4097 """Return True if type has a base type with the specified name.

Callers 10

infer_issubclass_mapsMethod · 0.80
is_type_objMethod · 0.80
narrow_declared_typeFunction · 0.80
visit_instanceMethod · 0.80
visit_instanceMethod · 0.80
get_protocol_memberFunction · 0.80

Calls 1

has_baseMethod · 0.95

Tested by

no test coverage detected