summaryrefslogtreecommitdiff
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Generally inehrit codeflags that are in PyCF_MASK, instead of writing it outThomas Wouters2006-02-281-4/+4
| | | | | in multiple places. This makes compile()/eval()/etc also inherit the absolute-import codeflag, like division and with-statement already were.
* Add some stats collection in debugging mode.Jeremy Hylton2006-02-281-3/+41
| | | | No good way to extract output yet.
* from __future__ import with_statement addon for 'with', mostly written byThomas Wouters2006-02-284-4/+10
| | | | Neal.
* Use simple PyList to implement list of PyObject pointersJeremy Hylton2006-02-281-44/+20
|
* TabifyJeremy Hylton2006-02-281-84/+87
|
* Remove asdl_seq_APPEND() and simplify asdl seq implementation.Jeremy Hylton2006-02-282-69/+57
| | | | Clarify intended use of set_context() and check errors at all call sites.
* Real arena implementationJeremy Hylton2006-02-281-62/+80
| | | | | Replace the toy arena implementation with a real one, based on allocating 8K chunks of memory by default.
* SF patch #1438387, PEP 328: relative and absolute imports.Thomas Wouters2006-02-289-55/+180
| | | | | | | | | | | | | | | | | | | | | | | - IMPORT_NAME takes an extra argument from the stack: the relativeness of the import. Only passed to __import__ when it's not -1. - __import__() takes an optional 5th argument for the same thing; it __defaults to -1 (old semantics: try relative, then absolute) - 'from . import name' imports name (be it module or regular attribute) from the current module's *package*. Likewise, 'from .module import name' will import name from a sibling to the current module. - Importing from outside a package is not allowed; 'from . import sys' in a toplevel module will not work, nor will 'from .. import sys' in a (single-level) package. - 'from __future__ import absolute_import' will turn on the new semantics for import and from-import: imports will be absolute, except for from-import with dots. Includes tests for regular imports and importhooks, parser changes and a NEWS item, but no compiler-package changes or documentation changes.
* Regenerate.Martin v. Löwis2006-02-281-0/+2
|
* Check the return code for PyErr_Warn() when warning about raising stringBrett Cannon2006-02-271-4/+5
| | | | | exceptions. This was triggered when 'warnings' had a filter set to "error" that caught the string exception deprecation warning.
* PyErr_ProgramText(): Grrrrrr.Tim Peters2006-02-271-1/+1
| | | | | | | | | | | In a Windows debug build, trying to open a file using an empty string as the name causes assertion death inside MS's C runtime code. We probably need to worm around that in many places. I'm worming around it here to stop the new test_with.py from assert-dying in the Windows debug build (it calls compile() with an empty string for "the file name", which indirectly leads to C-level code in Python trying to fopen("", "r")).
* Clarify C-style exception handling with proper label name.Thomas Wouters2006-02-271-3/+3
|
* Fix assertions.Thomas Wouters2006-02-271-3/+3
|
* PEP 343 -- the with-statement.Guido van Rossum2006-02-277-628/+981
| | | | | | | | | | | | | This was started by Mike Bland and completed by Guido (with help from Neal). This still needs a __future__ statement added; Thomas is working on Michael's patch for that aspect. There's a small amount of code cleanup and refactoring in ast.c, compile.c and ceval.c (I fixed the lltrace behavior when EXT_POP is used -- however I had to make lltrace a static global).
* Fix parsing of subscriptlist.Jeremy Hylton2006-02-271-4/+30
| | | | | | | (Armin's SF bug report). d = {} d[1,] = 1 Now handled correctly
* Patch 1413181, by Gabriel Becedillas.Tim Peters2006-02-271-0/+4
| | | | | | | | | PyThreadState_Delete(): if the auto-GIL-state machinery knows about the thread state, forget it (since the thread state is being deleted, continuing to remember it can't help, but can hurt if another thread happens to get created with the same thread id). I'll backport to 2.4 next.
* And some more cleanup.Thomas Wouters2006-02-271-2/+2
|
* Clean up from-import handling.Thomas Wouters2006-02-271-22/+21
|
* Simplify ast_for_trailer() in anticipation of more changes.Jeremy Hylton2006-02-271-17/+11
|
* Fix old not-reading-pep-308-right artifact.Thomas Wouters2006-02-271-1/+1
|
* Revert backwards-incompatible const changes.Martin v. Löwis2006-02-272-11/+12
|
* Fix assertion errors in debug build, brought on by PEP 308 patch.Thomas Wouters2006-02-271-1/+1
|
* Create _ast module.Martin v. Löwis2006-02-271-29/+345
| | | | Cleanup Python-ast.c generation.
* PEP 308 implementation, including minor refdocs and some testcases. ItThomas Wouters2006-02-275-520/+705
| | | | | | | | | | | | | | | | | | | | | | | | | breaks the parser module, because it adds the if/else construct as well as two new grammar rules for backward compatibility. If no one else fixes parsermodule, I guess I'll go ahead and fix it later this week. The TeX code was checked with texcheck.py, but not rendered. There is actually a slight incompatibility: >>> (x for x in lambda:0) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: iteration over non-sequence changes into >>> (x for x in lambda: 0) File "<stdin>", line 1 (x for x in lambda: 0) ^ SyntaxError: invalid syntax Since there's no way the former version can be useful, it's probably a bugfix ;)
* Avoid reinitializing the types twice.Martin v. Löwis2006-02-271-0/+1
|
* Stop generating empty arrays.Martin v. Löwis2006-02-261-117/+38
|
* Oops, I forgot to check this in with the change to Grammar/Grammar.Neal Norwitz2006-02-261-16/+3
| | | | | Implement change suggested by Jiwon Seo on python-dev. ['(' gen_for ')'] is redundant with test, so remove it.
* Check whether there are flags.Martin v. Löwis2006-02-261-1/+1
|
* Fix iterating over cmpop_ty lists.Martin v. Löwis2006-02-261-2/+7
|
* Generate code to recursively copy an AST intoMartin v. Löwis2006-02-263-725/+1556
| | | | a tree of Python objects. Expose this through compile().
* Based on discussion with Martin and Thomas on python-checkinsNeal Norwitz2006-02-201-1/+1
| | | | add a Py_SAFE_DOWNCAST() to make the code correct.
* Fix compiler warning on amd64. We can't use zd here since this isNeal Norwitz2006-02-191-2/+2
| | | | ultimately going to snprintf() not the python string formatter. Right?
* Fix compiler warning (int vs Py_ssize_t mismatchNeal Norwitz2006-02-191-1/+1
|
* Bug #801349: document that start/stop/step slice arguments can be NoneGeorg Brandl2006-02-191-1/+1
|
* Remove size constraints in SLICE opcodes.Martin v. Löwis2006-02-171-16/+11
|
* Move cast to suppress warning.Martin v. Löwis2006-02-161-2/+2
|
* Use Py_ssize_t to count theMartin v. Löwis2006-02-167-22/+24
|
* Use PyString_FromFormat for formatting error messages.Martin v. Löwis2006-02-161-42/+36
|
* Merge ssize_t branch.Martin v. Löwis2006-02-1515-187/+363
|
* Renamed _length_cue() to __length_hint__(). See:Armin Rigo2006-02-111-3/+3
| | | | http://mail.python.org/pipermail/python-dev/2006-February/060524.html
* Update general copyright years to 2006.Georg Brandl2006-02-111-1/+1
|
* Explain the clearing of the stack in a comment in Python/ceval.c'sThomas Wouters2006-02-101-1/+2
| | | | | call_function(), rather than commenting on the lack of an explanation in a comment.
* Add doc discussing how AST compiler is structured and designed.Brett Cannon2006-02-091-0/+507
| | | | | It is out of date, though, thanks to lacking info on the arena API. It also should eventually be removed in favor of updating PEP 339.
* Use C-style commentNeal Norwitz2006-02-051-1/+1
|
* Improved handling of syntax errors.Jeremy Hylton2006-01-271-35/+74
| | | | | | | | | | | | | | | | | Expand set of errors caught in set_context(). Some new errors, some old error messages changed for consistency. Fixed error checking in generator expression code. The first set of tests were impossible condition given the grammar. In general, the ast code uses REQ() for those sanity checks. Fix some error handling for augmented assignments. As comments in the code explain, set_context() ought to work here, but I got unexpected crashes when I tried it. Should come back to this. Add note to Grammar that yield expression is a special case. Add doctest cases for SyntaxErrors raised by ast.c.
* typoGeorg Brandl2006-01-201-1/+1
|
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-193-0/+6
| | | | Probably should be backported.
* Repair bizarre indentation created by VC 7.1.Tim Peters2006-01-081-1/+1
|
* alias_for_import_name(): Dueling compiler warnings ;-)Tim Peters2006-01-081-1/+2
| | | | | | | Squash new warnings from VC 7.1 about mixing signed and unsigned types in comparisons. I can see why `len` was changed to size_t here, but don't see why `i` was also changed. Change `i` back to int.
* analyze_cells(): This no longer compiled under VC 7.1.Tim Peters2006-01-081-1/+2
| | | | Move declaration of local `flags` to top of block.