> oh right, old_init(), sorry, didnt read the first post carefully.
>
> i almost think the answer here might be to not even create the
> modified __init__()/old_init() method in the general case...if
> youre calling session.save(someobject) its not really needed.
>
> but for now...maybe class.__init__.func_globals['oldinit'] ?
nah, i tried that, that is the globals of the module-level; while the 
locals that are inside the func... are in the .func_code. And 
especialy the outside-scope locally-bound references are 
the .func_code.co_freevars - but names only.

one way is to expose class._old__init__, or if that is not acceptable 
(which is understandable), to completely copy not only name & doc, 
but also func_defaults and the args/kwargs-names from .code - see 
inspect. But i dont think the .func_code attributes are writable, so 
they have to go under the function itself.
A really sneaky way would be to make/fake a new code obj - well, the 
doc says "not for faint at heart" (-:

now i am completely offtopic.
ciao

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to