Skip to main content

Note: This package is in the dangerous land of 0.x.y versions and may be subject to breaking changes with minor version increments.

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)

Copyright © 2020 Niklas Rosenstein

Metadata

Release files for nr.pylang.ast 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nr.pylang.ast 0.0.5
File Size Uploaded
nr.pylang.ast-0.0.5.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nr.pylang.ast 0.0.5
File Interpreter ABI Platform
nr.pylang.ast-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / nr.pylang.ast-0.0.5.tar.gz

Download URL nr.pylang.ast-0.0.5.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f0dc2a81cd3e08aa4349e7ab16a4945e7bd83acf961201f438bfabe7fbec9a3d
BLAKE2b-256 checksum
How to use checksums
812d81403b158e39addf57a817740da5d1b9a41a55ee479bc2a35927c97de6be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.3

Release files / nr.pylang.ast-0.0.5-py3-none-any.whl

Download URL nr.pylang.ast-0.0.5-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1a39380d88fab2c2a2bb816415df2afcb0b2d0bda2574af935c54a3e96264a5
BLAKE2b-256 checksum
How to use checksums
50f1ec7e550617dada84f2d19c85b4cdb5e6c7b37bb316bd0024895eafc2dceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page