Re: problem with Descriptors

2010-05-31 Thread Peter Otten
Steven W. Orr wrote: > I just discovered descriptors but what I want to do isn't working right. > That's the part that works. I'm trying to use the above construct to > implement a new kind of dict(). > > The idea is that I want to create a dict that knows about certain values > that can have de

problem with Descriptors

2010-05-31 Thread Steven W. Orr
I just discovered descriptors but what I want to do isn't working right. I hope this isn't too long. :-( Here's what I have that works: class C(object): def g(self): print "dir(g):",dir(self.g) def f(self, ss): print "ss = ", ss cc = C() cc.ff = f.__get__(C,cc) cc.ff('Round 3') And