Mercurial > cpython-lru_cache-weakref
annotate Lib/compiler/__init__.py @ 54294:dba767bc3155 legacy-trunk
remove mention of old ctypes version
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 23 May 2009 20:59:09 +0000 |
| parents | be8c43a3fd62 |
| children | a0a67c2fb7ff |
| rev | line source |
|---|---|
| 11926 | 1 """Package for parsing and compiling Python source code |
| 2 | |
| 3 There are several functions defined at the top level that are imported | |
| 4 from modules contained in the package. | |
| 5 | |
| 19946 | 6 parse(buf, mode="exec") -> AST |
| 17344 | 7 Converts a string containing Python source code to an abstract |
| 11926 | 8 syntax tree (AST). The AST is defined in compiler.ast. |
| 9 | |
| 10 parseFile(path) -> AST | |
| 11 The same as parse(open(path)) | |
| 12 | |
| 13 walk(ast, visitor, verbose=None) | |
| 14 Does a pre-order walk over the ast using the visitor instance. | |
| 15 See compiler.visitor for details. | |
|
11928
bdb5f6a524b5
import compile function form pycodegen
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
11926
diff
changeset
|
16 |
| 19946 | 17 compile(source, filename, mode, flags=None, dont_inherit=None) |
|
20547
a12ccdbce8da
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
20128
diff
changeset
|
18 Returns a code object. A replacement for the builtin compile() function. |
| 19946 | 19 |
| 20 compileFile(filename) | |
| 20128 | 21 Generates a .pyc file by compiling filename. |
| 11926 | 22 """ |
|
46818
be8c43a3fd62
Deprecate the compiler package for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
37408
diff
changeset
|
23 from warnings import warnpy3k |
|
be8c43a3fd62
Deprecate the compiler package for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
37408
diff
changeset
|
24 warnpy3k("the compiler package has been removed in Python 3.0", stacklevel=2) |
|
be8c43a3fd62
Deprecate the compiler package for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
37408
diff
changeset
|
25 del warnpy3k |
| 11926 | 26 |
| 37408 | 27 from compiler.transformer import parse, parseFile |
| 28 from compiler.visitor import walk | |
| 29 from compiler.pycodegen import compile, compileFile |
