Add a method to an existing class

Alex Martelli aleaxit at yahoo.com
Wed May 16 17:24:29 EDT 2001


"Pete Shinners" <pete at visionart.com> wrote in message
news:9duhb2$q8b$1 at news.unitel.co.kr...
    ...
> sadly, trying to assign the function to be a method of the instance
> doesn't work. the function doesn't really become a "method" it
> just remains a function, and it does get the "self" argument
> filled when called. i would really like to know if there is a
> clean way to actually make that function a full method?

Ah, see my immediately previous post -- a normal approach
is module new, but that post shows how you can also do it
otherwise (temporarily placing it in the class then removing
it again:-).


Alex






More information about the Python-list mailing list