llllllllll / codetransformer

Python code object transformers
http://codetransformer.readthedocs.io
GNU General Public License v2.0
184 stars 24 forks source link

Make decompiler and transformers optional #58

Open Kentzo opened 6 years ago

Kentzo commented 6 years ago

If I understand correctly, both decompiler and transformers are optional to the main functionality of the package: inspection and modification of code objects.

I propose to make both packages optional (e.g. via extras_require).

llllllllll commented 6 years ago

What would the benefit of this be?

Kentzo commented 6 years ago

The idea is to break dependency between generic core and utility functions that depend on specific Python. Version on codetransforms is currently broken for Python 3.6 because of them. Also see #60.

Perhaps they can be made optional (no import in __init__)?

llllllllll commented 6 years ago

The 3.6 issue has already been resolved on master. https://github.com/llllllllll/codetransformer/pull/57

Kentzo commented 6 years ago

Are there precautions against further opcode changes?

It would be unfortunate to end up with incompatible package because of this.

llllllllll commented 6 years ago

Not currently, is there a reason to be this worried about codetransformer breaking on new versions of Python. Currently we do not support new versions of python right away regardless of how codetransformer is packaged.

Kentzo commented 6 years ago

Given what this package tries to accomplish it's indeed impossible to give any promises since CPython does not give them in the first place. However, certain parts of CPython were proven to be more stable than other.

I do not see how users benefit of automatic import of utility classes that are more fragile than the rest of the package.