Re: Object Integer mapping

2010-01-20 Thread NighterNet
sh is different every time. Is > >> there a way to make the hash the same? I using as to check the class > >> is the same variables but if it different variable in the class that > >> it add to the array and return the index. > > >> # Generic Object->Int

Re: Object Integer mapping

2010-01-20 Thread Robert Kern
class is the same variables but if it different variable in the class that it add to the array and return the index. # Generic Object->Integer mapping # the object must be usable as a dictionary key class ObjMap: def __init__(self): self.dict = {} self.

Re: Object Integer mapping

2010-01-20 Thread Richard Thomas
t if it different variable in the class that > it add to the array and return the index. > > # Generic Object->Integer mapping > # the object must be usable as a dictionary key > class ObjMap: >         def __init__(self): >                 self.dict = {} >              

Object Integer mapping

2010-01-20 Thread NighterNet
array and return the index. # Generic Object->Integer mapping # the object must be usable as a dictionary key class ObjMap: def __init__(self): self.dict = {} self.next = 0 def get(self, obj): if obj in s