Skip to main content

Package description here.

Project description

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

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.2.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

nr.pylang.ast-0.0.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file nr.pylang.ast-0.0.2.tar.gz.

File metadata

  • Download URL: nr.pylang.ast-0.0.2.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for nr.pylang.ast-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c6143cf023405c93540e28dc12b6fcd99c22d0c4591c1c3316e137c672d26468
MD5 674434ca2319d88ba466bbbe3342dbf1
BLAKE2b-256 791b3ed4536c4e4bfef621bff878546687fe0ea1aac4bbb0aa1c3cbbac905042

See more details on using hashes here.

File details

Details for the file nr.pylang.ast-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: nr.pylang.ast-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for nr.pylang.ast-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0d246c0cf3341edbf4e74449b2923bc969ea21115bf6e054c23acccb1b6de23c
MD5 843eafac090f5e9b829b809a923531eb
BLAKE2b-256 d4bc0b88b1afa51c97f57481028c11c70048b5cd7b30375f49a7e708e06b564b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page