Package description here.
Project description
nr.pylang.ast
This package provides tools for processing the AST as generated by the Python
ast
module.
Module: dynamic_eval
This module provides an AST rewriter that takes and Read/Write operations on global variables and rewrites them to retrieve the variable by a function instead. Non-global variables are left untouched.
Example:
import os
from os import path
parent_dir = path.dirname(__file__)
def main():
filename = path.join(parent_dir, 'foo.py')
print(filename)
Will be converted to:
import os; __dict__['os'] = os
from os import path; __dict__['path'] = path
__dict__['parent_dir'] = __dict__['path'].dirname(__dict__['__file__'])
def main():
filename = __dict__['path'].join(__dict__['parent_dir'], 'foo.py')
__dict__['print'](filename)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nr.pylang.ast-0.0.1.tar.gz
(5.6 kB
view details)
File details
Details for the file nr.pylang.ast-0.0.1.tar.gz
.
File metadata
- Download URL: nr.pylang.ast-0.0.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 406b63ae35efedc8c441ebf63c9362236248c20c226afc5f0d8edf4ccf936b27 |
|
MD5 | 65a84b5de4340c0606420c297360073e |
|
BLAKE2b-256 | fdeff553a0e8d47e24bc704e9e9d8592f8aad3886d6b4fb7dfd8221ac94df60b |