MCPcopy Index your code
hub / github.com/python/cpython / _compare_fields

Function _compare_fields

Lib/ast.py:455–470  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

453 return type(a) is type(b) and a == b
454
455 def _compare_fields(a, b):
456 if a._fields != b._fields:
457 return False
458 for field in a._fields:
459 a_field = getattr(a, field, sentinel)
460 b_field = getattr(b, field, sentinel)
461 if a_field is sentinel and b_field is sentinel:
462 # both nodes are missing a field at runtime
463 continue
464 if a_field is sentinel or b_field is sentinel:
465 # one of the node is missing a field
466 return False
467 if not _compare(a_field, b_field):
468 return False
469 else:
470 return True
471
472 def _compare_attributes(a, b):
473 if a._attributes != b._attributes:

Callers 1

compareFunction · 0.85

Calls 1

_compareFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…