bend or redirect a class method and then call it again

Francesco scrutinizer at gmx.at
Sat Jul 24 05:46:39 EDT 2004


On Fri, 23 Jul 2004 13:45:07 -0700, Jeff Shannon <jeff at ccvcorp.com>
wrote:

>Ah, well, then I *was* misunderstanding -- I'm not sure how I became 
>convinced that Plugin was a derived class, but convinced I was, and 
>built all further opinions on top of that false conviction.
>
>I'd say that if you want a function to alter the behavior of all objects 
>of a particular class, it's probably better to have some sort of flag as 
>a class variable, and have your function set that flag rather than 
>rebind a method.  I'd still be inclined to think that this should be 
>done on a per-instance basis, rather than for the entire class, but I 
>can see some case to be made for changing the entire class, too.
>
>Perhaps you can define a StatusTextFormat attribute on drFrame, and have 
>drFrame.SetStatusText() apply that format to all text before feeding it 
>to wx.Frame.SetStatusText().  Plugin() would then change this 
>StatusTextFormat.  You could implement this as either a function to be 
>called, or use % string formatting...


thank you again for your answer.
I have to think about it.

-- 
Franz Steinhaeusler



More information about the Python-list mailing list