MCPcopy Index your code
hub / github.com/RustPython/RustPython / method_incompatibility_reason

Function method_incompatibility_reason

scripts/whats_left.py:345–358  ·  view source on GitHub ↗
(typ, method_name, real_method_value)

Source from the content-addressed store, hash-verified

343 from contextlib import redirect_stdout
344
345 def method_incompatibility_reason(typ, method_name, real_method_value):
346 has_method = hasattr(typ, method_name)
347 if not has_method:
348 return ""
349
350 is_inherited = not attr_is_not_inherited(typ, method_name)
351 if is_inherited:
352 return "(inherited)"
353
354 value = extra_info(getattr(typ, method_name))
355 if value != real_method_value:
356 return f"{value} != {real_method_value}"
357
358 return None
359
360 not_implementeds = {}
361 for name, (typ, real_value, methods) in expected_methods.items():

Callers 1

compareFunction · 0.85

Calls 4

hasattrFunction · 0.85
attr_is_not_inheritedFunction · 0.85
extra_infoFunction · 0.85
getattrFunction · 0.85

Tested by

no test coverage detected