Opened 8 years ago
Last modified 8 years ago
#27309 closed Bug
Missing Hash function in CallableBool — at Initial Version
Description ¶
As CallableBool has no hash function, membership test operations for sets do not work:
from django.utils.deprecation import CallableTrue assert CallableTrue in {True} TypeError: unhashable type: 'CallableBool'
Adding a hash function solves this problem:
def __hash__(self): return hash(self.value)
I'm happy to create a PR if this make sense.
Note:
See TracTickets
for help on using tickets.