How can I determine the property attributes on a class or instance?

2006-04-11 Thread 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 XXX

Re: How can I determine the property attributes on a class or instance?

2006-04-11 Thread Ben Cartwright
mrdylan wrote: 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 XXX --- What is the

Re: How can I determine the property attributes on a class or instance?

2006-04-11 Thread Steven D'Aprano
On Tue, 11 Apr 2006 19:11:46 -0700, mrdylan wrote: 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 calls

Re: How can I determine the property attributes on a class or instance?

2006-04-11 Thread Steven D'Aprano
Replying to myself now... how sad. On Wed, 12 Apr 2006 15:19:17 +1000, Steven D'Aprano wrote: If you want a general purpose solution for an object introspection tool, I must admit I'm as lost as you are. The only thing I have come up with is this nasty hack: t.p is None True dir(t.p) is