Re: Adding bound methods dynamically... CORRECTED



Kevin Little wrote:
> I want to dynamically add or replace bound methods in a class. I want
> the modifications to be immediately effective across all instances,
> whether created before or after the class was modified. I need this
> to work for both old ('classic') and new style classes, at both 2.3
> and 2.4. I of course want to avoid side effects, and to make the
> solution as light-weight as possible.
>
> Question for the experts: Is the solution coded in AddBoundMethod()
> acceptable to the Pythonian Gods? :) It does seem to work -- tested
> at 2.3.5 (RH Linux) and 2.4.1 (WinXP)
>
> [Code]

I'm not an expert, but why do you need to dynamically add or replace
bound methods?

.



Relevant Pages

  • Re: Adding bound methods dynamically... CORRECTED
    ... > Devan L wrote: ... >> Kevin Little wrote: ... >>>I want to dynamically add or replace bound methods in a class. ... > discovered first-class functions and anonymous functions with Python ...
    (comp.lang.python)
  • Re: Adding bound methods dynamically... CORRECTED
    ... > Kevin Little wrote: ... >>I want to dynamically add or replace bound methods in a class. ... discovered first-class functions and anonymous functions with Python ...
    (comp.lang.python)