R
Rim
Hi,
Is there a way to get any sort of introspection which would return the
content of an instance *in the order they were declared or executed*
as opposed to alphabetical order?
Example:
.... def __init__(self):
.... self.value = 12
.... self.avalue = 78.... def __init__(self):
.... a.__init__(self)
.... self.bvalue = 5
.... def f(self):
.... self.z = 3
.... {'bvalue': 5, 'avalue': 78, 'value': 12}
Wrong answer, I am looking for something that would give me
{'value':12, 'avalue':78, 'bvalue':5'}
I tried the inspect.getmembers(c) without success.
Anyone has some advice how I can get the members listed in declaration
or execution order?
Thanks
-Rim
Is there a way to get any sort of introspection which would return the
content of an instance *in the order they were declared or executed*
as opposed to alphabetical order?
Example:
.... def __init__(self):
.... self.value = 12
.... self.avalue = 78.... def __init__(self):
.... a.__init__(self)
.... self.bvalue = 5
.... def f(self):
.... self.z = 3
.... {'bvalue': 5, 'avalue': 78, 'value': 12}
Wrong answer, I am looking for something that would give me
{'value':12, 'avalue':78, 'bvalue':5'}
I tried the inspect.getmembers(c) without success.
Anyone has some advice how I can get the members listed in declaration
or execution order?
Thanks
-Rim