summaryrefslogtreecommitdiff
path: root/Python/symtable.c
AgeCommit message (Collapse)AuthorLines
2018-11-16Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576)Miss Islington (bot)-1/+3
This missed PyErr_NoMemory() could cause a SystemError when calling _symtable.symtable(). (cherry picked from commit ad65f15581173542f1d2a9968a63bee272510ce3) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-10-10Fix a possible decref of a borrowed reference in symtable.c. (GH-9786)Miss Islington (bot)-2/+4
(cherry picked from commit fc439d20de32b0ebccca79a96e31f83b85ec4eaf) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-03-10bpo-32836: Remove obsolete code from symtable pass (GH-5680)Miss Islington (bot)-25/+0
When comprehensions switched to using a nested scope, the old code for generating a temporary name to hold the accumulation target became redundant, but was never actually removed. Patch by Nitish Chandra. (cherry picked from commit 3a087beddd9f0955eb9080a6fd1499ff89ca74bf) Co-authored-by: Nitish Chandra <nitishchandrachinta@gmail.com>
2017-12-01bpo-10544: Deprecate "yield" in comprehensions and generator expressions. ↵Serhiy Storchaka-1/+30
(GH-4579) The current behaviour of yield expressions inside comprehensions and generator expressions is essentially an accident of implementation - it arises implicitly from the way the compiler handles yield expressions inside nested functions and generators. Since the current behaviour wasn't deliberately designed, and is inherently confusing, we're deprecating it, with no current plans to reintroduce it. Instead, our advice will be to use a named nested generator definition for cases where this behaviour is desired.
2017-10-27bpo-28936: Detect lexically first syntax error first (#4097)Ivan Levkivskyi-18/+16
Lexically first global and nonlocal syntax errors at given scope should be detected first.
2017-09-07bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow-0/+4
* group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
2016-11-16Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka-2/+2
_PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
2016-11-16Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka-2/+2
_PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
2016-09-23Issue #28100: Refactor error messages, patch by Ivan LevkivskyiChristian Heimes-12/+8
2016-09-09Issue #28008: Implement PEP 530 -- asynchronous comprehensions.Yury Selivanov-0/+6
2016-09-09Issue #27999: Make "global after use" a SyntaxError, and ditto for nonlocal.Guido van Rossum-68/+36
Patch by Ivan Levkivskyi.
2016-09-08Issue #28003: Implement PEP 525 -- Asynchronous Generators.Yury Selivanov-2/+4
2016-09-08Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.Yury Selivanov-0/+56
Patch by Ivan Levkivskyi.
2016-09-09Fix potential NULL pointer dereference in update_symbols()Christian Heimes-1/+1
symtable_analyze() calls analyze_block() with bound=NULL. Theoretically that NULL can be passed down to update_symbols(). update_symbols() may deference NULL and pass it to PySet_Contains()
2016-06-04Merge typo fixes from 3.5Martin Panter-1/+1
2016-06-04Fix typos in code comment and documentationMartin Panter-1/+1
2016-01-26Add ast.ConstantVictor Stinner-0/+1
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
2015-12-29merge 3.5 (#25973)Benjamin Peterson-8/+16
2015-12-29make recording and reporting errors and nonlocal and global directives more ↵Benjamin Peterson-8/+16
robust (closes #25973)
2015-12-25Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka-2/+2
private functions.
2015-09-19Issue #24965: Implement PEP 498 "Literal String Interpolation". ↵Eric V. Smith-0/+8
Documentation is still needed, I'll open an issue for that.
2015-07-22Issue #24619: More tests; fix nits in compiler.cYury Selivanov-1/+1
2015-07-03Issue #19235: Add new RecursionError exception. Patch by Georg Brandl.Yury Selivanov-2/+2
2015-05-11PEP 0492 -- Coroutines with async and await syntax. Issue #24017.Yury Selivanov-6/+43
2015-05-05PEP 448: additional unpacking generalizations (closes #2292)Benjamin Peterson-18/+8
Patch by Neil Girdhar.
2015-04-27remove the concept of an unoptimized function scope from the compiler, since ↵Benjamin Peterson-16/+0
it can't happen anymore
2015-04-24remove dead *-import checking code (closes #24049)Benjamin Peterson-31/+0
2013-09-26merge 3.3 (#19098)Benjamin Peterson-2/+6
2013-09-26don't scale compiler stack frames if the recursion limit is huge (closes #19098)Benjamin Peterson-2/+6
2013-08-26Close #11619: The parser and the import machinery do not encode UnicodeVictor Stinner-15/+40
filenames anymore on Windows.
2013-07-11Issue #18408: ste_new() initialize all attributes before handling errorVictor Stinner-13/+9
If an attribute is not initialized, the destructor can crash
2013-05-16move definition to top of blockBenjamin Peterson-1/+2
2013-05-16rather than passing locals to the class body, just execute the class body in ↵Benjamin Peterson-6/+1
the proper environment
2013-05-15complain about "global __class__" in a class body (closes #17983)Benjamin Peterson-0/+6
2013-05-15hide the __class__ closure from the class body (#12370)Benjamin Peterson-15/+19
2013-03-18unify some ast.argument's attrs; change Attribute column offset (closes #16795)Benjamin Peterson-6/+6
Patch from Sven Brauch.
2012-12-06create NameConstant AST class for None, True, and False literals (closes #16619)Benjamin Peterson-0/+1
2012-11-25Issue #16546: merge fix from 3.3Mark Dickinson-6/+6
2012-11-25Issue #16546: make ast.YieldFrom argument mandatory.Mark Dickinson-6/+6
2012-11-04Issue #5765: Merge from 3.3Nick Coghlan-31/+70
2012-11-04Issue #5765: Apply a hard recursion limit in the compilerNick Coghlan-29/+68
Previously, excessive nesting in expressions would blow the stack and segfault the interpreter. Now, a hard limit based on the configured recursion limit and a hardcoded scaling factor is applied.
2012-10-31point errors related to nonlocals and globals to the statement declaring ↵Benjamin Peterson-8/+49
them (closes #10189)
2012-10-31check return value of _PyUnicode_AsStringBenjamin Peterson-2/+6
2012-09-12Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to ↵Christian Heimes-1/+3
decref 'k' in too many error cases.
2012-09-12Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to ↵Christian Heimes-1/+3
decref 'k' in too many error cases.
2012-09-12Partly revert ad3824a90261 and add comment about reference ownershipChristian Heimes-2/+1
2012-09-12Partly revert ad3824a90261 and add comment about reference ownershipChristian Heimes-2/+1
2012-09-10Closed reference leak of variable 'k' in function ste_new which wasn't ↵Christian Heimes-1/+2
decrefed in error cases
2012-09-10Closed reference leak of variable 'k' in function ste_new which wasn't ↵Christian Heimes-1/+2
decrefed in error cases
2012-05-27Close #14857: fix regression in references to PEP 3135 implicit __class__ ↵Nick Coghlan-11/+8
closure variable. Reopens issue #12370, but also updates unittest.mock to workaround that issue