M
marco
hi
I've got a class "myClass" ... and i CAN'T EXTENDS this class!
But i can add NEW methods to "myClass", like that :
method = new.instancemethod( myNewMethod , None, myClass)
myClass.__dict__[method.__name__] = method
i'd like to add NEW attributs to "myClass" ...
i'm pretty sure it's possible (with "get/set-attr") ... but i don't know how
to do that
in fact, i'd like to wrap an newAttribut to an existingAttribut ...
can anyone drop me 3 lines on how to do that ?
I've got a class "myClass" ... and i CAN'T EXTENDS this class!
But i can add NEW methods to "myClass", like that :
method = new.instancemethod( myNewMethod , None, myClass)
myClass.__dict__[method.__name__] = method
i'd like to add NEW attributs to "myClass" ...
i'm pretty sure it's possible (with "get/set-attr") ... but i don't know how
to do that
in fact, i'd like to wrap an newAttribut to an existingAttribut ...
can anyone drop me 3 lines on how to do that ?