Adding methods to an object
Gabriele *darkbard* Farina
darkbard at gmail.com
Thu Oct 13 09:06:20 EDT 2005
More information about the Python-list mailing list
Thu Oct 13 09:06:20 EDT 2005
- Previous message (by thread): Adding methods to an object
- Next message (by thread): Adding methods to an object
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, there is a way to add methods to an object dynamically? I need to do something like this. I remember python allowed this ... class A(object): def do(s, m): print m @staticmethod def init(obj): obj.do = A.do class Test(object): pass o = Test() A.init(o) o.do(10) Now it gives me an error ... unbound method ... tnx, gabriele
- Previous message (by thread): Adding methods to an object
- Next message (by thread): Adding methods to an object
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list