smarie / python-makefun

Dynamically create python functions with a proper signature.
https://smarie.github.io/python-makefun/
BSD 3-Clause "New" or "Revised" License
119 stars 16 forks source link

[WIP] make `@compile_fun` correctly recurse through imported names, to try to fix #52 #53

Open smarie opened 4 years ago

smarie commented 4 years ago

This is work in progress: basically co_names should be used (done)

But it seems that there are issues with the way the eval dict (globals/locals) is propagated. Indeed when an external symbol is compiled, the eval dict should not be propagated. Instead its own eval dict should be used. This is available through target.__globals__ for functions, but not for other symbols (classes...).

Not sure all of this is done correctly today but I actually do not have time to dedicate to it as I am not sure about the potential benefits :)