Serhiy Storchaka
bba2239c17
bpo-31572: Get rid of _PyObject_HasAttrId() in the ASDL parser. ( #3725 )
Silence only expected AttributeError.
8 years ago
INADA Naoki
a6296d34a4
bpo-31095: fix potential crash during GC (GH-2974)
8 years ago
Yuan Chao Chou
2af565baf4
Fix a shadow-compatible-local warning ( #2180 )
Change the shadowing naming, 'value' (Python-ast.c:4652), to 'val'
to prevent the variables from being misused.
9 years ago
INADA Naoki
4c78c527d2
bpo-29622: Make AST constructor to accept less than enough number of positional arguments (GH-249)
bpo-29463 added optional "docstring" field to 4 AST types.
While it is optional, it breaks backward compatibility because AST constructor
requires number of positional argument is same to number of fields.
AST types accepts empty arguments, and incomplete keyword arguments.
But it's not big problem because field can be filled after creation, and checked when compiling.
So stop requiring complete set of fields for positional arguments too.
9 years ago
INADA Naoki
cb41b2766d
bpo-29463: Add docstring field to some AST nodes. ( #46 )
* bpo-29463: Add docstring field to some AST nodes.
ClassDef, ModuleDef, FunctionDef, and AsyncFunctionDef has docstring
field for now. It was first statement of there body.
* fix document. thanks travis!
* doc fixes
9 years ago
INADA Naoki
fc489082c8
Issue #29369 : Use Py_IDENTIFIER in Python-ast.c
9 years ago
Serhiy Storchaka
228b12edcc
Issue #28999 : Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
9 years ago
Serhiy Storchaka
cf3806026b
Issue #24098 : Fixed possible crash when AST is changed in process of
compiling it.
9 years ago
Yury Selivanov
52c4e7cc84
Issue #28008 : Implement PEP 530 -- asynchronous comprehensions.
9 years ago
Yury Selivanov
f8cb8a16a3
Issue #27985 : Implement PEP 526 -- Syntax for Variable Annotations.
Patch by Ivan Levkivskyi.
9 years ago
Victor Stinner
25219f596a
Issue #26146 : remove useless code
obj2ast_constant() code is baesd on obj2ast_object() which has a special case
for Py_None. But in practice, we don't need to have a special case for
constants.
Issue noticed by Joseph Jevnik on a review.
10 years ago
Victor Stinner
f2c1aa1661
Add ast.Constant
Issue #26146 : Add a new kind of AST node: ast.Constant. It can be used by
external AST optimizers, but the compiler does not emit directly such node.
An optimizer can replace the following AST nodes with ast.Constant:
* ast.NameConstant: None, False, True
* ast.Num: int, float, complex
* ast.Str: str
* ast.Bytes: bytes
* ast.Tuple if items are constants too: tuple
* frozenset
Update code to accept ast.Constant instead of ast.Num and/or ast.Str:
* compiler
* docstrings
* ast.literal_eval()
* Tools/parser/unparse.py
10 years ago
Victor Stinner
f9827ea618
Issue #25555 : Fix parser and AST: fill lineno and col_offset of "arg" node when
compiling AST from Python objects.
10 years ago
Victor Stinner
c106c68aeb
Issue #25555 : Fix parser and AST: fill lineno and col_offset of "arg" node when
compiling AST from Python objects.
10 years ago
Eric V. Smith
235a6f0984
Issue #24965 : Implement PEP 498 "Literal String Interpolation". Documentation is still needed, I'll open an issue for that.
10 years ago
Serhiy Storchaka
56f6e76c68
Issue #15989 : Fixed some scarcely probable integer overflows.
It is very unlikely that they can occur in real code for now.
10 years ago
Yury Selivanov
7544508f02
PEP 0492 -- Coroutines with async and await syntax. Issue #24017 .
11 years ago
Benjamin Peterson
025e9ebd0a
PEP 448: additional unpacking generalizations ( closes #2292 )
Patch by Neil Girdhar.
11 years ago
Benjamin Peterson
d51374ed78
PEP 465: a dedicated infix operator for matrix multiplication ( closes #21176 )
12 years ago
Benjamin Peterson
665a2bcdf8
bump Python-ast.c
12 years ago
Benjamin Peterson
c2f665e721
don't put runtime values in array initializer for C89 compliance ( closes #20588 )
12 years ago
Antoine Pitrou
d01d396e7f
Issue #4555 : All exported C symbols are now prefixed with either "Py" or "_Py".
("make smelly" now clean)
12 years ago
Christian Heimes
70c94e7896
Issue #18552 : Check return value of PyArena_AddPyObject() in obj2ast_object().
13 years ago
Victor Stinner
1acc129d48
Parser/asdl_c.py: use Py_CLEAR()
13 years ago
Victor Stinner
ce72e1ce6c
According to the PEP 7, C code must "use 4-space indents"
Replace 8 spaces with 4.
13 years ago
Victor Stinner
bdf630c4a7
Issue #18408 : Fix Python-ast.c: handle init_types() failure (ex: MemoryError)
13 years ago
Charles-Francois Natali
74ca886788
Issue #17917 : Use PyModule_AddIntMacro() instead of PyModule_AddIntConstant()
when applicable.
13 years ago
Benjamin Peterson
3a61943b7b
bump Python-ast.c
13 years ago
Benjamin Peterson
b72406b8fa
refactor to fix refleaks
13 years ago
Benjamin Peterson
cda75be02a
unify some ast.argument's attrs; change Attribute column offset ( closes #16795 )
Patch from Sven Brauch.
13 years ago
Andrew Svetlov
f7a17b48d7
Replace IOError with OSError ( #16715 )
13 years ago
Trent Nelson
25a48610a8
Make PyAST_obj2mod C89 compliant. (Follow-up commit from asdl_c.py.)
13 years ago
Benjamin Peterson
442f20996d
create NameConstant AST class for None, True, and False literals ( closes #16619 )
13 years ago
Mark Dickinson
ded35aeb9d
Issue #16546 : make ast.YieldFrom argument mandatory.
13 years ago
Benjamin Peterson
8107176f9b
add gc support to the AST base type ( closes #15293 )
14 years ago
Antoine Pitrou
507507473e
Issue #15291 : Fix a memory leak where AST nodes where not properly deallocated.
14 years ago
Benjamin Peterson
77fa9379e2
use Py_ssize_t for ast sequence lengths
14 years ago
Martin v. Löwis
41829e82c1
Document f4d7ad6c9d6e.
14 years ago
Martin v. Löwis
cc10a37ef0
Widen ASDL sequences to Py_ssize_t lengths to better match PEP 353.
14 years ago
Benjamin Peterson
1767e0274b
free AST's dict
14 years ago
Victor Stinner
45e50de1f5
Try to fix compilation of Python-ast.c on Visual Studio 2008
14 years ago
Benjamin Peterson
7e0dbfbbde
give the AST class a __dict__
14 years ago
Benjamin Peterson
527c622926
make YieldFrom its own distinct from Yield ( closes #13780 )
14 years ago
Antoine Pitrou
5136ac0ca2
Issue #13645 : pyc files now contain the size of the corresponding source
code, to avoid timestamp collisions (especially on filesystems with a low
timestamp resolution) when checking for freshness of the bytecode.
14 years ago
Nick Coghlan
1f7ce62bd6
Implement PEP 380 - 'yield from' ( closes #11682 )
14 years ago
Amaury Forgeot d'Arc
5e8f810411
Issue #13436 : commit regenerated Python-ast.c
14 years ago
Martin v. Löwis
1c67dd9b15
Port SetAttrString/HasAttrString to SetAttrId/GetAttrId.
14 years ago
Martin v. Löwis
bd928fef42
Rename _Py_identifier to _Py_IDENTIFIER.
14 years ago
Martin v. Löwis
1ee1b6fe0d
Use identifier API for PyObject_GetAttrString.
14 years ago
Benjamin Peterson
0224d4e699
accept bytes for the AST 'string' type
This is a temporary kludge and all is well in 3.3.
15 years ago