make enums hashable

This commit is contained in:
Madeleine Thompson
2016-12-05 22:27:40 -05:00
parent 468375d566
commit 93ea35e558
2 changed files with 10 additions and 0 deletions

View File

@@ -943,6 +943,10 @@ cdef class _DynamicEnum:
elif op == 5: # >=
return left >= right
def __hash__(_DynamicEnum self):
return hash(self._as_str())
cdef class _DynamicEnumField:
cdef _init(self, proto):
self.thisptr = proto