MCPcopy
hub / github.com/python/mypy / is_method_final

Method is_method_final

mypyc/ir/class_ir.py:286–298  ·  view source on GitHub ↗
(self, name: str)

Source from the content-addressed store, hash-verified

284 return True
285
286 def is_method_final(self, name: str) -> bool:
287 subs = self.subclasses()
288 if subs is None:
289 return self.is_final_class
290
291 if self.has_method(name):
292 method_decl = self.method_decl(name)
293 for subc in subs:
294 if subc.method_decl(name) != method_decl:
295 return False
296 return True
297 else:
298 return not any(subc.has_method(name) for subc in subs)
299
300 def has_attr(self, name: str) -> bool:
301 try:

Callers 6

bool_valueMethod · 0.80
add_bool_branchMethod · 0.80
translate_eq_cmpMethod · 0.80
visit_get_attrMethod · 0.80
emit_method_callMethod · 0.80

Calls 4

subclassesMethod · 0.95
has_methodMethod · 0.95
method_declMethod · 0.95
anyFunction · 0.85

Tested by

no test coverage detected