← Back to issue list

refactor: Make DistroBase hashable

View original Github issue

Metadata

Project
craft-platforms
Number
#231
Type
issue
State
open
Author
lengau
Labels
—
Created
Updated
Closed
—

Current evaluation

DistroBase already receives a dataclass-generated hash despite custom equality, but that exact-field hash may conflict with equality for compatible series prefixes such as 24 and 24.04, so hashing semantics need triage.

Suggested action: needs triage

Reason: The pinned source uses @dataclass(frozen=True), so Python generates __hash__ despite the custom __eq__, contradicting the reported unhashable-type behavior. However, __eq__ considers series such as 24 and 24.04 equal, making the generated exact-field hash inconsistent; with no labels or comments confirming whether explicit prefix-compatible hashing is intended, maintainer review is needed.

Evaluated by: mr-cal-bot

Impact: 32 Quick Win: 12 Complexity: 38 Confidence: 92 Actionability: 60

Issue body

Currently, `DistroBase` is a `frozen` dataclass but overrides `__eq__` manually without defining `__hash__`. This implicitly makes `DistroBase` unhashable, raising `TypeError: unhashable type: 'DistroBase'` when used in a set or as a dictionary key. Create a `__hash__` method for DistroBase.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 32
Quick Win: 12
Complexity: 38
Confidence: 92
Actionability: 60
needs triage DistroBase already receives a dataclass-generated hash despite custom equality, but that exact-field hash may conflict with equality for compatible series prefixes such as 24 and 24.04, so hashing semantics need triage.
stealth/space-bunny-alpha
Impact: 28
Quick Win: 23
Complexity: 12
Confidence: 95
Actionability: 92
needs triage DistroBase is unhashable because its custom equality method disables the frozen dataclass hash; adding a consistent __hash__ and regression tests is ready for development.
qwen3.6-35b-a3b-mtp-q6
Impact: 40
Quick Win: 34
Staleness: 60
Complexity: 15
Confidence: 75
Support Request: 5
needs triage DistroBase is a frozen dataclass with custom __eq__ but no __hash__, making it unhashable. Issue created 81 days ago with no labels or maintainer comments.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 15
Confidence: 90
Support Request: 0
needs triage Unhashable DistroBase dataclass due to missing __hash__ method after overriding __eq__. Issue is unlabelled and has received no maintainer comments or activity in 36 days.
qwen3.6-35b-a3b-mtp-q6
Staleness: 30
Complexity: 10
Confidence: 90
Support Request: 0
needs triage Request to implement a hash method for DistroBase to resolve a TypeError when used in sets or as dictionary keys. Currently unlabelled and awaiting implementation.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.