Ticket #2639 (new defect)

Opened 2 years ago

axiom.item.Item and subclasses are not hashable

Reported by: exarkun Assigned to: glyph
Priority: normal Milestone:
Component: Axiom Severity: normal
Keywords: Cc:
Estimated Completion (YYYY/MM/DD): Branch:
Author:

Description

axiom.item.MetaItem overrides comparison via __cmp__. However, it doesn't implement __hash__. Therefore, it is not hashable and instances of MetaItem cannot be used as dictionary keys or included in sets.

A related matter is that MetaItem implements comparison such that all the legacy types for a given typename compare equal to each other and equal to the non-legacy type for that typename.

jethro@divmod.org