auth.Auth: Add methods __eq__() and .__hash__() #7

Merged
Jan Lindemann merged 1 commit from jan/feature/20261125-auth-auth-add-methods-eq-and-hash into master 2026-11-25 12:22:27 +01:00 AGit
Owner

auth.Auth: Add methods eq() and .hash()

Entity instances are compared by identity. The forge clients create a fresh Owner object on every lookup, so two objects denoting the same user are never equal, and equality-based matching - permission checks, caches keyed on the entity - does not work.

Give Entity value equality: two entities are equal when they carry the same kind and the same name. __hash__() is derived from the same fields, so entities remain usable as dict keys and in sets.

#### auth.Auth: Add methods __eq__() and .__hash__() Entity instances are compared by identity. The forge clients create a fresh Owner object on every lookup, so two objects denoting the same user are never equal, and equality-based matching - permission checks, caches keyed on the entity - does not work. Give Entity value equality: two entities are equal when they carry the same kind and the same name. `__hash__()` is derived from the same fields, so entities remain usable as dict keys and in sets.
auth.Auth: Add methods __eq__() and .__hash__()
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m43s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 5m58s
CI / Packaging test (pull_request) Successful in 0s
819d6283bd
Entity instances are compared by identity. The forge clients create a fresh
Owner object on every lookup, so two objects denoting the same user are
never equal, and equality-based matching - permission checks, caches keyed
on the entity - does not work.

Give Entity value equality: two entities are equal when they carry the same
kind and the same name. __hash__() is derived from the same fields, so
entities remain usable as dict keys and in sets.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.6.0
Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-11-25 12:10:44 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-python!7
No description provided.