Skip to content

Include inherited slots when hashing slotted objects - #642

Open
Kenoia wants to merge 1 commit into
qlustered:devfrom
Kenoia:fix/inherited-slot-hashing
Open

Kenoia wants to merge 1 commit into
qlustered:devfrom
Kenoia:fix/inherited-slot-hashing

Conversation

@Kenoia

@Kenoia Kenoia commented Oct 7, 2026 •

Copy link
Copy Markdown

DeepHash iterates obj.__slots__, which can omit parent-defined slots and split a string declaration into characters. Different slot values can then produce equal hashes, causing ignore_order=True to miss changes.

  • Collect declared slots across the MRO and treat a string declaration as one slot
  • Keep the existing uninitialized-slot and __getattr__ behavior
  • Add 11 regression/control cases for inheritance, declaration forms, fallback behavior and ignored type groups

Related: #506 and #577

Validation:

  • Full pytest suite, including slow tests: 1320 passed, 8 skipped (Python 3.13)
  • All 11 added regression and control cases pass
  • Pyright and the CI flake8 error gate passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant