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 hashes)