There's a program, it's result is "unexpected aaa", i want it to be
"expected aaa". how to make it work?

[code]

class C1(object):
        def v(self, o):
                return "expected "+o

class C2(object):
        def v(self, o):
                return "unexpected "+o
        def m(self):
                print self.v("aaa")

class C3(object):
        def nothing(self):
                pass

def test1():
        o = C3()
        setattr(o,"m",C2().m)
        setattr(o,"v",C1().v)
        o.m()

test1() 

[/code]

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to