> btw if u find a way to obtain some externaly-bound non-global
> reference from func's code (see what dis.dis() shows), DO mail...
Bot sure to understand precisely what you want to do, but it seems like monkey
patching:
class Klass(object):
def incredible_func(self):
a = 2
print "a: %s" % a
o = Klass()
o.incredible_func() # "a: 2"
def awesome_func(self):
b = 17
print "b: %s" % b
Klass.incredible_func = awesome_func
another_o = Klass()
o.incredible_func() # "b: 17"
It implies rewriting the whole body func, not just find/replace as in your
example. Maybe that's what you want to avoid...
Seb
--
Sébastien LELONG
sebastien.lelong[at]sirloon.net
>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---