27 May
2004
27 May
'04
9 p.m.
From: zope-bounces@zope.org [mailto:zope-bounces@zope.org] On Behalf Of Alec Mitchell
Which won't acquire anything but the method. The reason I want to avoid a subclass or monkey patch is that I want to override what this method does for this one instance of an already populated acl_users without changing it in any other way.
In Python, you can override a method of an instance just by assigning it to another function, like this - class Test1: def f1(self): return "f1() of Test1" def f1(): return "f1() of instance" T1 = Test1() T1.f1 = f1 Running this within the Python interpreter, try the following -
T1.f1() 'f1() of instance'
Is this what you had in mind? Cheers, Tom P