nvbn / __transformers__
Experimental module for AST transformations
Stars: ✭ 11
Programming Languages
python
139335 projects - #7 most used programming language
Experimental module for AST transformations
Install
pip install git+https://github.com/nvbn/__transformers__
Usage
Available transformations:
-
ellipsis_partial
–map(lambda x: x + 1, ...)
tolambda y: map(lambda x: x + 1, y)
; -
matmul_pipe
–"hello world" @ print
toprint("hello world")
.
Enable transformations in code:
from __transformers__ import ellipsis_partial, matmul_pipe
range(10) @ map(lambda x: x ** 2, ...) @ list @ print
Run code with transformations:
➜ python -m __transformers__ -m python_module
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
➜ python -m __transformers__ python/module/path.py
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
Manually enable transformations from code:
from __transformers__ import setup
setup()
import module_that_use_transformers
Rationale
License MIT
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].