Skip to content

Commit 51a840a

Browse files
committed
transformer, ast, syntax: Remove deprecated modules.
These modules were concerned with converting Python parse tree into AST in Python versions 1.5.x - early 2.x. Since then, the "ast" module, with elaborated API, was promoted to the top-level module in Python stdlib. Previous changes in this repository were concerned with porting other modules (symbols, pycodegen, etc.) from those historical modules to the modern "ast" module. Thus, these modules are unused and removed to clean up the package and ease maintenance. Note that the topic of parsing Python source code into AST using pure-Python module(s) is definitely interesting, but better be pursued via separate project(s). This project has well-defined scope - compile a standard Python AST into bytecode and code objects.
1 parent 1145ff3 commit 51a840a

File tree

5 files changed

+2
-2972
lines changed

5 files changed

+2
-2972
lines changed

compiler/__init__.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
"""Package for parsing and compiling Python source code
1+
"""Package for compiling Python source code
22
33
There are several functions defined at the top level that are imported
44
from modules contained in the package.
55
6-
parse(buf, mode="exec") -> AST
7-
Converts a string containing Python source code to an abstract
8-
syntax tree (AST). The AST is defined in compiler.ast.
9-
10-
parseFile(path) -> AST
11-
The same as parse(open(path))
12-
136
walk(ast, visitor, verbose=None)
147
Does a pre-order walk over the ast using the visitor instance.
158
See compiler.visitor for details.
@@ -21,11 +14,5 @@
2114
Generates a .pyc file by compiling filename.
2215
"""
2316

24-
import warnings
25-
26-
warnings.warn("The compiler package is deprecated and removed in Python 3.x.",
27-
DeprecationWarning, stacklevel=2)
28-
29-
from compiler.transformer import parse, parseFile
3017
from compiler.visitor import walk
3118
from compiler.pycodegen import compile, compileFile

0 commit comments

Comments
 (0)