diff --git a/examples/Makefile b/examples/Makefile index fc39c55448fc0246f0ddbba0c05e24c7bc2e0b1d..b217cff14e98788bc33b2063d363b08c71cd4f44 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -17,7 +17,7 @@ ifeq ($(UNAME_S),Darwin) else cd simple ; sh compile.sh && sh run.sh $(MAKE) -C wiki_example test - $(MAKE) -C user_types test + $(MAKE) -C user_types all endif $(MAKE) -C duck_typing test $(MAKE) -C twoway test diff --git a/lib/python/labcomm2014/LabComm.py b/lib/python/labcomm2014/LabComm.py index b309124f3eb39602bd99a4f9dd99813d6e2da30d..b00f0ee83559baadd9d6905f7a1d72bf4858e4c3 100644 --- a/lib/python/labcomm2014/LabComm.py +++ b/lib/python/labcomm2014/LabComm.py @@ -637,8 +637,7 @@ class struct(type_decl): return not self.__eq__(other) def __hash__(self): - tmp = str(self.field) - return hash(self.__class__) ^ hash(tmp) + return hash(self.__class__) ^ hash(self.field) def encode_decl(self, encoder): encoder.encode_type(i_STRUCT) @@ -961,6 +960,11 @@ class Decoder(Codec): handler(data) else: print ("No handler for %s" % decl.name ) + for key, value in self.handlers.iteritems(): + if key == decl: + print "but value %s == decl %s" % (key,decl) + print "hashes %d : %d" % (hash(key),hash(decl)) + raise Exception() def decode(self): while True: