summaryrefslogtreecommitdiff
path: root/Python/graminit.c
AgeCommit message (Collapse)AuthorLines
2005-10-23Backport: SF bug #1167751: fix incorrect code being for generator expressions.Neal Norwitz-7/+15
2004-08-31SF patch #1007189, multi-line imports, for instance:Anthony Baxter-781/+835
"from blah import (foo, bar baz, bongo)"
2004-08-17This is Mark Russell's patch:Michael W. Hudson-15/+14
[ 1009560 ] Fix @decorator evaluation order From the description: Changes in this patch: - Change Grammar/Grammar to require newlines between adjacent decorators. - Fix order of evaluation of decorators in the C (compile.c) and python (Lib/compiler/pycodegen.py) compilers - Add better order of evaluation check to test_decorators.py (test_eval_order) - Update the decorator documentation in the reference manual (improve description of evaluation order and update syntax description) and the comment: Used Brett's evaluation order (see http://mail.python.org/pipermail/python-dev/2004-August/047835.html) (I'm checking this in for Anthony who was having problems getting SF to talk to him)
2004-08-02PEP-0318, @decorator-style. In Guido's words:Anthony Baxter-1079/+1135
"@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
2004-05-19SF patch #872326: Generator expression implementationRaymond Hettinger-299/+400
(Code contributed by Jiwon Seo.) The documentation portion of the patch is being re-worked and will be checked-in soon. Likewise, PEP 289 will be updated to reflect Guido's rationale for the design decisions on binding behavior (as described in in his patch comments and in discussions on python-dev). The test file, test_genexps.py, is written in doctest format and is meant to exercise all aspects of the the patch. Further additions are welcome from everyone. Please stress test this new feature as much as possible before the alpha release.
2002-08-04Patch #534304: Implement phase 1 of PEP 263.Martin v. Löwis-4/+17
2002-05-24Disambiguate the grammar for backtick.Guido van Rossum-57/+71
The old syntax suggested that a trailing comma was OK inside backticks, but in fact (due to ideosyncrasies of pgen) it was not. Fix the grammar to avoid the ambiguity. Fred: you may want to update the refman.
2002-05-23John Aycock correctly pointed out that the grammar forTim Peters-3/+2
"power" was formally ambiguous. Here's his fix.
2001-10-15Very subtle syntax change: in a list comprehension, the testlist inGuido van Rossum-101/+129
"for <var> in <testlist> may no longer be a single test followed by a comma. This solves SF bug #431886. Note that if the testlist contains more than one test, a trailing comma is still allowed, for maximum backward compatibility; but this example is not: [(x, y) for x in range(10), for y in range(10)] ^ The fix involved creating a new nonterminal 'testlist_safe' whose definition doesn't allow the trailing comma if there's only one test: testlist_safe: test [(',' test)+ [',']]
2001-08-08Implement PEP 238 in its (almost) full glory.Guido van Rossum-192/+196
This introduces: - A new operator // that means floor division (the kind of division where 1/2 is 0). - The "future division" statement ("from __future__ import division) which changes the meaning of the / operator to implement "true division" (where 1/2 is 0.5). - New overloadable operators __truediv__ and __floordiv__. - New slots in the PyNumberMethods struct for true and floor division, new abstract APIs for them, new opcodes, and so on. I emphasize that without the future division statement, the semantics of / will remain unchanged until Python 3.0. Not yet implemented are warnings (default off) when / is used with int or long arguments. This has been on display since 7/31 as SF patch #443474. Flames to /dev/null.
2001-06-18Merging the gen-branch into the main line, at Guido's direction. Yay!Tim Peters-654/+673
Bugfix candidate in inspect.py: it was referencing "self" outside of a method.
2000-08-24Support for three-token characters (**=, >>=, <<=) which was written byThomas Wouters-749/+801
Michael Hudson, and support in general for the augmented assignment syntax. The graminit.c patch is large!
2000-08-22require list comprehensions to start with a for clauseSkip Montanaro-5/+5
2000-08-21PEP 214, Extended print Statement, has been accepted by the BDFL.Barry Warsaw-122/+151
eval_code2(): Implement new bytecodes PRINT_ITEM_TO and PRINT_NEWLINE_TO, as per accepted SF patch #100970. Also update graminit.c based on related Grammar/Grammar changes.
2000-08-17Apply SF patch #101135, adding 'import module as m' and 'from module importThomas Wouters-636/+680
name as n'. By doing some twists and turns, "as" is not a reserved word. There is a slight change in semantics for 'from module import name' (it will now honour the 'global' keyword) but only in cases that are explicitly undocumented.
2000-08-12list comprehensions. seeSkip Montanaro-199/+294
http://sourceforge.net/patch/?func=detailpatch&patch_id=100654&group_id=5470 for details.
2000-03-28slightly modified version of Greg Ewing's extended call syntax patchJeremy Hylton-21/+40
executive summary: Instead of typing 'apply(f, args, kwargs)' you can type 'f(*arg, **kwargs)'. Some file-by-file details follow. Grammar/Grammar: simplify varargslist, replacing '*' '*' with '**' add * & ** options to arglist Include/opcode.h & Lib/dis.py: define three new opcodes CALL_FUNCTION_VAR CALL_FUNCTION_KW CALL_FUNCTION_VAR_KW Python/ceval.c: extend TypeError "keyword parameter redefined" message to include the name of the offending keyword reindent CALL_FUNCTION using four spaces add handling of sequences and dictionaries using extend calls fix function import_from to use PyErr_Format
1998-04-09Make first raise argument optionalGuido van Rossum-2/+3
1997-05-07Oops, missed some renamings.Guido van Rossum-1/+1
1997-04-16OK, ready to make 'assert' a keyword (instead of '__assert__').Guido van Rossum-1/+1
1997-04-02Added assert grammar.Guido van Rossum-493/+521
1996-08-12Disable support for access statementGuido van Rossum-584/+532
1996-07-30Changes for slice and ellipsesGuido van Rossum-103/+144
1996-01-12changes for power (**) operatorGuido van Rossum-324/+358
1995-07-07new grammarGuido van Rossum-74/+142
1995-01-07Grammar changedGuido van Rossum-462/+476
1994-08-30Merge back to main trunkGuido van Rossum-78/+94
1993-11-30change syntactical position of lambdef (was an atom, now is a test)Guido van Rossum-73/+81
1993-11-30* import.c (get_module): pass .py filename to parse_file, not .pyc filename!Guido van Rossum-624/+626
* funcobject.c (func_repr): don't call getstringvalue(None) for anonymous functions. * bltinmodule.c: removed lambda (which is now a built-in function); removed implied lambda for string arg to filter/map/reduce. * Grammar, graminit.[ch], compile.[ch]: replaced lambda as built-in function by lambda as grammar entity: instead of "lambda('x: x+1')" you write "lambda x: x+1". * Xtmodule.c (checkargdict): return 0, not NULL, for error.
1993-10-27Committing the correct graminit.c; also changed confusing comments in Grammar.Guido van Rossum-714/+697
1993-10-26* compile.[ch]: support for lambda()Guido van Rossum-675/+701
* PROTO.h, mymalloc.h: added #ifdefs for TURBOC and GNUC. * allobjects.h: added #include "rangeobject.h" * Grammar: added lambda_input; relaxed syntax for exec. * bltinmodule.c: added bagof, map, reduce, lambda, xrange. * tupleobject.[ch]: added resizetuple(). * rangeobject.[ch]: new object type to speed up range operations (not convinced this is needed!!!)
1993-10-18* bltinmodule.c: removed exec() built-in function.Guido van Rossum-395/+432
* Grammar: add exec statement; allow testlist in expr statement. * ceval.c, compile.c, opcode.h: support exec statement; avoid optimizing locals when it is used * fileobject.{c,h}: add getfilename() internal function.
1993-06-17* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.Guido van Rossum-16/+25
Added $(SYSDEF) to its build rule in Makefile. * cgensupport.[ch], modsupport.[ch]: removed some old stuff. Also changed files that still used it... And made several things static that weren't but should have been... And other minor cleanups... * listobject.[ch]: add external interfaces {set,get}listslice * socketmodule.c: fix bugs in new send() argument parsing. * sunaudiodevmodule.c: added flush() and close().
1993-05-19Several changes in one:Guido van Rossum-488/+486
(1) dictionaries/mappings now have attributes values() and items() as well as keys(); at the C level, use the new function mappinggetnext() to iterate over a dictionary. (2) "class C(): ..." is now illegal; you must write "class C: ...". (3) Class objects now know their own name (finally!); and minor improvements to the way how classes, functions and methods are represented as strings. (4) Added an "access" statement and semantics. (This is still experimental -- as long as you don't use the keyword 'access' nothing should be changed.)
1992-04-06Latest gramamrGuido van Rossum-132/+130
1992-03-31tightened try statement syntaxGuido van Rossum-10/+22
1992-03-24*** empty log message ***Guido van Rossum-601/+699
1991-07-27New grammar (semicolons, continue, no multiple NEWLINES)Guido van Rossum-537/+576
1991-02-19Added copyright notice.Guido van Rossum-0/+24
1990-12-20"Compiling" versionGuido van Rossum-1/+1
1990-10-26removed dir statement. Function arguments may now be tests.Guido van Rossum-484/+460
1990-10-14Initial revisionGuido van Rossum-0/+1094