You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need the ability to obtain function source code at runtime for various introspection purposes. Since Python 3.9+, and Python3.11 even more, cannot be easily decompiled, I cheated. The results are here.
While properly decompiling code is needed for dynamically generated code, complex template logic, and when you don't have the original source code available, sometimes it's sufficient to simply automate fetching the relevant lines of source code out of the source file.
The fake decompiler is zlib licensed, so you're welcome to hoist it into your own stuff if you like, or just link to it on the readme. Hopefully it will be of some use.
Note that I'm out of time to implement recreating the function signature to support lambdas better. It should take maybe half an hour to do, just need to extract the arguments and stringify them suitably. Faking signatures works.
The text was updated successfully, but these errors were encountered:
Description
I need the ability to obtain function source code at runtime for various introspection purposes. Since Python 3.9+, and Python3.11 even more, cannot be easily decompiled, I cheated. The results are here.
While properly decompiling code is needed for dynamically generated code, complex template logic, and when you don't have the original source code available, sometimes it's sufficient to simply automate fetching the relevant lines of source code out of the source file.
The fake decompiler is zlib licensed, so you're welcome to hoist it into your own stuff if you like, or just link to it on the readme. Hopefully it will be of some use.
Note that I'm out of time to implement recreating the function signature to support lambdas better. It should take maybe half an hour to do, just need to extract the arguments and stringify them suitably.Faking signatures works.The text was updated successfully, but these errors were encountered: