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

Method has_base

mypy/nodes.py:4096–4104  ·  view source on GitHub ↗

Return True if type has a base type with the specified name. This can be either via extension or via implementation.

(self, fullname: str)

Source from the content-addressed store, hash-verified

4094 )
4095
4096 def has_base(self, fullname: str) -> bool:
4097 """Return True if type has a base type with the specified name.
4098
4099 This can be either via extension or via implementation.
4100 """
4101 for cls in self.mro:
4102 if cls.fullname == fullname:
4103 return True
4104 return False
4105
4106 def direct_base_classes(self) -> list[TypeInfo]:
4107 """Return a direct base classes.

Callers 15

is_metaclassMethod · 0.95
check_func_defMethod · 0.80
dangerous_comparisonMethod · 0.80
recalculate_metaclassMethod · 0.80
_type_object_overlapFunction · 0.80
is_overlapping_typesFunction · 0.80
typed_dict_mapping_pairFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected