~gnarea/booleano/main

« back to all changes in this revision

Viewing changes to src/booleano/nodes/constants.py

  • Committer: Gustavo Narea
  • Date: 2010-11-08 22:32:29 UTC
  • Revision ID: me@gustavonarea.net-20101108223229-dju8os2tbez8ovjc
Made Nodes hashable

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
        if super(Constant, self).__eq__(other):
64
64
            equivalent = other._constant_value == self._constant_value
65
65
        return equivalent
 
66
    
 
67
    def __hash__(self):
 
68
        """Return the hash of the value represented."""
 
69
        hash_ = hash(self._constant_value)
 
70
        return hash_
66
71
 
67
72
 
68
73
class String(Constant, StringType):