i’m writing two anidated classes one is a dict the other a list?
having the trouble with the second as told,
the dict works as next,
class Field( dict ):
def __keys__(self):
self.k = self.keys()
return list(self.k)
def __setattr__( self, attr, value):
self[attr] = value
i’d like instead of adding as next,
class Store(list):
instead i would like to use the same high perfomance dict() with some indexing object
and a list sub-argument
what would be the most correct way to implement the data tree? any ideas?
I am going to posit an answer. I think you want quick access to some collection of objects while being able to keep them in order. You might be able to get away with something as simple as an
ordereddict. If not, something like this might come close. It’ll depend on your data.