M
mrdylan
Given a class like so:
-------------------------------
class TestMe(object):
def get(self):
pass
def set(self, v):
pass
p = property( get, set )
t = TestMe()
type(t.p) #returns NoneType, what???
t.p.__str__ #returns <method-wrapper object at XXXXXXX>
-----------------------------------
What is the best way to determine that the attribute t.p is actually a
property object? Obviously I can test the __str__ or __repr__
attributes using substring comparison but there must be a more elegant
idiom.
thanks!
-------------------------------
class TestMe(object):
def get(self):
pass
def set(self, v):
pass
p = property( get, set )
t = TestMe()
type(t.p) #returns NoneType, what???
t.p.__str__ #returns <method-wrapper object at XXXXXXX>
-----------------------------------
What is the best way to determine that the attribute t.p is actually a
property object? Obviously I can test the __str__ or __repr__
attributes using substring comparison but there must be a more elegant
idiom.
thanks!