auth.Auth: Add methods __eq__() and .__hash__() #7
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20261125-auth-auth-add-methods-eq-and-hash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.