0

I have created a class.

class DictToObject(object):
    def __init__(self, entries): 
        self.__dict__.update(entries)

    def id(self):
        keyColumn = self['KEY_COL_TX']
        keyValue = self[keyColumn]
        return keyValue # a string

The instances of this class are to be considered equal if o1.id() equals o2.id()

But I dont think it is possible to create a unique integer for all string values, so I need some other way to compare object equality without using __hash__()

Terrence Brannon
  • 4,760
  • 7
  • 42
  • 61

0 Answers0