summaryrefslogtreecommitdiff
path: root/Python/symtable.c
AgeCommit message (Collapse)AuthorLines
2013-09-26don't scale compiler stack frames if the recursion limit is huge (closes #19098)Benjamin Peterson-2/+6
2013-05-16move definition to top of blockBenjamin Peterson-1/+2
2013-05-15complain about "global __class__" in a class body (closes #17983)Benjamin Peterson-0/+6
2012-11-25Issue #16546: make ast.YieldFrom argument mandatory.Mark Dickinson-6/+6
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-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
2012-01-14make YieldFrom its own distinct from Yield (closes #13780)Benjamin Peterson-2/+6
2012-01-13Implement PEP 380 - 'yield from' (closes #11682)Nick Coghlan-19/+0
2011-11-04Issue #13343: Fix a SystemError when a lambda expression uses a globalAmaury Forgeot d'Arc-0/+3
variable in the default value of a keyword-only argument: (lambda *, arg=GLOBAL_NAME: None)
2011-11-04Issue #13343: Fix a SystemError when a lambda expression uses a globalAmaury Forgeot d'Arc-0/+3
variable in the default value of a keyword-only argument: (lambda *, arg=GLOBAL_NAME: None)
2011-09-28Implement PEP 393.Martin v. Löwis-4/+4
2011-07-02fix possibily uninitialized memory usage (closes #12474)Benjamin Peterson-2/+2
2011-06-29store the current scope on the stack right awayBenjamin Peterson-21/+18
2011-06-29remove VISIT_*_IN_BLOCK macrosBenjamin Peterson-41/+10
These are pointless because on error, all blocks will be finalized by symtable_dealloc.
2011-06-20merge 3.2Benjamin Peterson-6/+6
2011-06-20fix indentationBenjamin Peterson-6/+6
2011-06-19use a invalid name for the __class__ closure for super() (closes #12370)Benjamin Peterson-8/+11
This prevents the assignment of __class__ in the class body from breaking super. (Although a determined person could do locals()["@__class__"] = 4)
2011-05-29unify TryExcept and TryFinally (closes #12199)Benjamin Peterson-8/+5
2011-05-27reflect with statements with multiple items in the AST (closes #12106)Benjamin Peterson-4/+12
2011-04-10Issue #9904: fix and clarify some comments + fix indentation in symtable codeEli Bendersky-4/+4
2010-10-20fix uninitialized struct member #10152Benjamin Peterson-0/+1
2010-10-16don't identify the toplevel namespace by name #9997Benjamin Peterson-1/+1
2010-09-20add column offset to all syntax errorsBenjamin Peterson-24/+37
2010-07-20revert unintended changesBenjamin Peterson-9/+2
2010-07-20move test_trace.py so as not to conflict with future tests for the trace moduleBenjamin Peterson-2/+9
2010-06-11Merged revisions 81906 via svnmerge fromBenjamin Peterson-1/+1
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81906 | benjamin.peterson | 2010-06-11 16:40:37 -0500 (Fri, 11 Jun 2010) | 1 line different spellings are just unacceptable ........
2010-05-09Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou-1256/+1256
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
2009-11-20Merged revisions 76423-76424 via svnmerge fromBenjamin Peterson-3/+2
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76423 | benjamin.peterson | 2009-11-19 19:15:53 -0600 (Thu, 19 Nov 2009) | 1 line provide line number for lambdas ........ r76424 | benjamin.peterson | 2009-11-19 19:16:58 -0600 (Thu, 19 Nov 2009) | 1 line genexps have linenos ........
2009-06-28Merged revisions ↵Benjamin Peterson-9/+1
73376,73393,73398,73400,73404-73405,73409,73419-73421,73432,73457,73460,73485-73486,73488-73489,73501-73502,73513-73514 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r73376 | benjamin.peterson | 2009-06-11 17:29:23 -0500 (Thu, 11 Jun 2009) | 1 line remove check for case handled in sub-function ........ r73393 | alexandre.vassalotti | 2009-06-12 13:56:57 -0500 (Fri, 12 Jun 2009) | 2 lines Clear reference to the static PyExc_RecursionErrorInst in _PyExc_Fini. ........ r73398 | alexandre.vassalotti | 2009-06-12 15:57:12 -0500 (Fri, 12 Jun 2009) | 3 lines Add const qualifier to PyErr_SetFromErrnoWithFilename and to PyErr_SetFromErrnoWithUnicodeFilename. ........ r73400 | alexandre.vassalotti | 2009-06-12 16:43:47 -0500 (Fri, 12 Jun 2009) | 2 lines Delete outdated make file for building the parser with MSVC 6. ........ r73404 | benjamin.peterson | 2009-06-12 20:40:00 -0500 (Fri, 12 Jun 2009) | 1 line keep the slice.step field as NULL if no step expression is given ........ r73405 | benjamin.peterson | 2009-06-12 22:46:30 -0500 (Fri, 12 Jun 2009) | 1 line prevent import statements from assigning to None ........ r73409 | benjamin.peterson | 2009-06-13 08:06:21 -0500 (Sat, 13 Jun 2009) | 1 line allow importing from a module named None if it has an 'as' clause ........ r73419 | benjamin.peterson | 2009-06-13 11:19:19 -0500 (Sat, 13 Jun 2009) | 1 line set Print.values to NULL if there are no values ........ r73420 | benjamin.peterson | 2009-06-13 12:08:53 -0500 (Sat, 13 Jun 2009) | 1 line give a better error message when deleting () ........ r73421 | benjamin.peterson | 2009-06-13 15:23:33 -0500 (Sat, 13 Jun 2009) | 1 line when no module is given in a 'from' relative import, make ImportFrom.module NULL ........ r73432 | amaury.forgeotdarc | 2009-06-14 16:20:40 -0500 (Sun, 14 Jun 2009) | 3 lines #6227: Because of a wrong indentation, the test was not testing what it should. Ensure that the snippet in doctest_aliases actually contains aliases. ........ r73457 | benjamin.peterson | 2009-06-16 18:13:09 -0500 (Tue, 16 Jun 2009) | 1 line add underscores ........ r73460 | benjamin.peterson | 2009-06-16 22:23:04 -0500 (Tue, 16 Jun 2009) | 1 line remove unused 'encoding' member from the compiler struct ........ r73485 | benjamin.peterson | 2009-06-19 17:07:47 -0500 (Fri, 19 Jun 2009) | 1 line remove duplicate test ........ r73486 | benjamin.peterson | 2009-06-19 17:09:17 -0500 (Fri, 19 Jun 2009) | 1 line add missing assertion #6313 ........ r73488 | benjamin.peterson | 2009-06-19 17:16:28 -0500 (Fri, 19 Jun 2009) | 1 line show that this one isn't used ........ r73489 | benjamin.peterson | 2009-06-19 17:21:12 -0500 (Fri, 19 Jun 2009) | 1 line use closures ........ r73501 | benjamin.peterson | 2009-06-21 18:01:07 -0500 (Sun, 21 Jun 2009) | 1 line don't need to add the name 'lambda' as assigned ........ r73502 | benjamin.peterson | 2009-06-21 18:03:36 -0500 (Sun, 21 Jun 2009) | 1 line remove tmpname support since it's no longer used ........ r73513 | benjamin.peterson | 2009-06-22 20:18:57 -0500 (Mon, 22 Jun 2009) | 1 line fix grammar ........ r73514 | benjamin.peterson | 2009-06-22 22:01:56 -0500 (Mon, 22 Jun 2009) | 1 line remove some unused symtable constants ........
2009-05-12fix error handling of PyNumber_InPlaceOr #6000Benjamin Peterson-16/+26
2009-04-02remove unused variableBenjamin Peterson-1/+0
2009-04-02rewrite error handling to make senseBenjamin Peterson-3/+7
2009-04-02fix ref leaksBenjamin Peterson-0/+2
2009-03-31Merged revisions 70801,70809 via svnmerge fromJeremy Hylton-20/+94
svn+ssh://pythondev@svn.python.org/python/trunk The merge ran into a lot of conflicts because dicts were replaced with sets in the Python 3 version of the symbol table. ........ r70801 | jeremy.hylton | 2009-03-31 09:17:03 -0400 (Tue, 31 Mar 2009) | 3 lines Add is_declared_global() which distinguishes between implicit and explicit global variables. ........ r70809 | jeremy.hylton | 2009-03-31 09:48:15 -0400 (Tue, 31 Mar 2009) | 14 lines Global statements from one function leaked into parallel functions. Re http://bugs.python.org/issue4315 The symbol table used the same name dictionaries to recursively analyze each of its child blocks, even though the dictionaries are modified during analysis. The fix is to create new temporary dictionaries via the analyze_child_block(). The only information that needs to propagate back up is the names of the free variables. Add more comments and break out a helper function. This code doesn't get any easier to understand when you only look at it once a year. ........
2009-03-03instead of hacking __locals__ in during bytecode generation, put it in the ↵Benjamin Peterson-2/+5
symtable
2009-02-02Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson-1/+1
type of tp_compare in a separate commit, for ease of reversion should things go wrong.
2008-08-17Merged revisions 65715,65724,65726,65732,65736-65739,65775 via svnmerge fromBenjamin Peterson-4/+9
svn+ssh://pythondev@svn.python.org/python/trunk ........ r65715 | benjamin.peterson | 2008-08-16 16:04:16 -0500 (Sat, 16 Aug 2008) | 1 line add some documentation for symtable ........ r65724 | benjamin.peterson | 2008-08-16 17:11:33 -0500 (Sat, 16 Aug 2008) | 2 lines include filename and line number in SyntaxError ........ r65726 | georg.brandl | 2008-08-16 17:37:05 -0500 (Sat, 16 Aug 2008) | 2 lines Review symtable docs. ........ r65732 | benjamin.peterson | 2008-08-16 18:29:40 -0500 (Sat, 16 Aug 2008) | 1 line PySTEntry's constructor is static; there's no point in a fancy API name ........ r65736 | benjamin.peterson | 2008-08-16 20:09:17 -0500 (Sat, 16 Aug 2008) | 1 line expose PySTEntry.nested so the symtable module will work ........ r65737 | benjamin.peterson | 2008-08-16 20:17:15 -0500 (Sat, 16 Aug 2008) | 1 line a few improvements ........ r65738 | benjamin.peterson | 2008-08-16 20:27:30 -0500 (Sat, 16 Aug 2008) | 1 line fix compile errors ........ r65739 | benjamin.peterson | 2008-08-16 21:23:43 -0500 (Sat, 16 Aug 2008) | 1 line uhh PySTEntry->ste_unoptimized has to be exposed too ........ r65775 | benjamin.peterson | 2008-08-17 12:13:26 -0500 (Sun, 17 Aug 2008) | 5 lines get the symtable module back in working order - Fix broken functions - Add (hopefully) extensive tests - Modernize a little ........
2008-08-07Rename PyUnicode_AsString -> _PyUnicode_AsString andMarc-André Lemburg-2/+2
PyUnicode_AsStringAndSize -> _PyUnicode_AsStringAndSize to mark them for interpreter internal use only. We'll have to rework these APIs or create new ones for the purpose of accessing the UTF-8 representation of Unicode objects for 3.1.
2008-03-31Merged revisions 62047 via svnmerge fromNeal Norwitz-5/+5
svn+ssh://pythondev@svn.python.org/python/trunk ........ r62047 | georg.brandl | 2008-03-29 23:40:17 -0700 (Sat, 29 Mar 2008) | 2 lines Patch #2511: Give the "excepthandler" AST item proper attributes by making it a Sum. ........
2008-03-16Merged revisions 61404-61407 via svnmerge fromChristian Heimes-2/+3
svn+ssh://pythondev@svn.python.org/python/trunk ........ r61404 | raymond.hettinger | 2008-03-15 21:02:04 +0100 (Sat, 15 Mar 2008) | 17 lines Removed Exact/Inexact after discussion with Yasskin. Unlike Scheme where exactness is implemented as taints, the Python implementation associated exactness with data types. This created inheritance issues (making an exact subclass of floats would result in the subclass having both an explicit Exact registration and an inherited Inexact registration). This was a problem for the decimal module which was designed to span both exact and inexact arithmetic. There was also a question of use cases and no examples were found where ABCs for exactness could be used to improve code. One other issue was having separate tags for both the affirmative and negative cases. This is at odds with the approach taken elsewhere in the Python (i.e. we don't have an ABC both Hashable and Unhashable). ........ r61405 | raymond.hettinger | 2008-03-15 21:37:50 +0100 (Sat, 15 Mar 2008) | 1 line Zap one more use of Exact/Inexact. ........ r61406 | neal.norwitz | 2008-03-15 23:03:18 +0100 (Sat, 15 Mar 2008) | 9 lines Add a warning for code like: assert (0, 'message') An empty tuple does not create a warning. While questionable usage: assert (), 'message' should not display a warning. Tested manually. The warning message could be improved. Feel free to update it. ........ r61407 | neal.norwitz | 2008-03-15 23:36:01 +0100 (Sat, 15 Mar 2008) | 1 line Handle memory allocation failure. Found by Adam Olsen ........
2007-12-02Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases ↵Christian Heimes-22/+22
in intobject.h
2007-10-29Bug #1356: Avoid using the C99 keyword 'restrict'.Martin v. Löwis-4/+4
2007-08-31Issue #1066: implement PEP 3109, 2/3 of PEP 3134.Collin Winter-7/+5