[Cython] replacing methods

Brian Blais bblais at gmail.com
Mon Apr 28 22:59:45 CEST 2008


On Apr 28, 2008, at Apr 28:4:51 PM, Robert Bradshaw wrote:
> Yes, the way Python deals with (bound/unbound) instance methods,  
> functions, builtin methods, etc. is not one of the most transparent  
> parts of Python...


>  What you need to do is
>
>     import types
>     mything.doit  = types.MethodType(testit.doit, None, mything)
>

wow!  I never would have gotten that one...gotta put that in my  
notes.  I wonder why it is so convoluted?


		thanks a million,


				Brian Blais



More information about the Cython-dev mailing list