Skip to main content

This is a pure-Python implementation of the “ast” module as described in CPython documentation. It is written for the Pycopy project, the minimalist Python dialect, and is a part of its standard library, pycopy-lib. However, it can also run under CPython and other Python implementations.

Implementation-wise, it is laid out as a package, with the following submodules:

  • ast.types, with AST node types auto-generated from CPython’s ASDL description.

  • ast.parser, implementing hand-written parser for Python 3.6, utilizing recursive descent to parse statements, and Pratt operator precedence parser to parse expressions.

  • ast, the main package, integrating submodules above, and exposing CPython-compatible API with corresponding additional functions and classes to process AST trees.

At the time of writing, the parser supports Python 3.6 syntax. Updates for the next versions of Python syntax are expected to follow.

The package has small builtin test corpus to check that the AST trees match the ones generated by CPython, and can also use entire CPython standard library as a test corpus, which it also can parse correctly (but with some discrepancies, e.g. this module is optimized for minimal size and doesn’t support Unicode named escape sequences (in the same way as Pycopy doesn’t support them)).

Pycopy’s ast module is written by Paul Sokolovsky and provided under the MIT license.

Metadata

Release files for pycopy-ast 2.9.1

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

Source distribution (sdist)

Source distribution for pycopy-ast 2.9.1
File Size Uploaded
pycopy-ast-2.9.1.tar.gz 11.7 kB Details

Release files / pycopy-ast-2.9.1.tar.gz

Download URL pycopy-ast-2.9.1.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a8cc1b5672d75e51c77ec4a7f2674e0f9e99691ae285a7c79a90a9944b46d049
BLAKE2b-256 checksum
How to use checksums
1d347d12f5b35b5f80852d0243a117d56e1feca8125807ce2cd26f6fe1149d41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release history Release notifications | RSS feed

This release

2.9.1 This release

1 release file

2.9

1 release file

2.8

1 release file

2.7

1 release file

2.6

1 release file

2.5

1 release file

2.4

1 release file

2.3.6

1 release file

2.3.5

1 release file

2.3.4

1 release file

2.3.3

1 release file

2.3.2

1 release file

2.3.1

1 release file

2.3

1 release file

2.2.1

1 release file

2.2

1 release file

2.1

1 release file

2.0

1 release file

1.9

1 release file

1.8

1 release file

1.7

1 release file

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

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