3 ms·
The method described is for recovering and decompiling bytecode into equivalent Python code, which is not exactly the same thing as source code, since it won't
by bdowling 10y ago
The method described is for recovering and decompiling bytecode into equivalent Python code, which is not exactly the same thing as source code, since it won't contain things like comments and unexported object names.
edit: made more accurate
- dr_zoidberg 10y agoIndeed, but it just gave me an idea for a weird use case we've been discussing at work :)
- Latty 10y agoOf course, Python is a little better than most languages for things like 'comments' - as a lot of them aren't really comments but docstrings, which are actually a part of the class, not a true comment, and so presumably can be restored.
- lewk 10y agoNot if you use `python -OO`, which will optimize the docstrings out.