[Zope] Override a method of an instance in the ZODB?
tpassin at mitretek.org
Thu May 27 17:00:43 EDT 2004
> From: zope-bounces at zope.org [mailto:zope-bounces at 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 -
return "f1() of Test1"
return "f1() of instance"
T1 = Test1()
T1.f1 = f1
Running this within the Python interpreter, try the following -
'f1() of instance'
Is this what you had in mind?
More information about the Zope