| 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: |