summaryrefslogtreecommitdiffstats
path: root/Python/graminit.c
Commit message (Collapse)AuthorAgeFilesLines
* Patch #534304: Implement phase 1 of PEP 263.Martin v. Löwis2002-08-041-4/+17
|
* Disambiguate the grammar for backtick.Guido van Rossum2002-05-241-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.
* John Aycock correctly pointed out that the grammar forTim Peters2002-05-231-3/+2
| | | | "power" was formally ambiguous. Here's his fix.
* Very subtle syntax change: in a list comprehension, the testlist inGuido van Rossum2001-10-151-102/+130
| | | | | | | | | | | | | | | "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)+ [',']]
* Implement PEP 238 in its (almost) full glory.Guido van Rossum2001-08-081-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.
* Merging the gen-branch into the main line, at Guido's direction. Yay!Tim Peters2001-06-181-658/+677
| | | | | Bugfix candidate in inspect.py: it was referencing "self" outside of a method.
* Support for three-token characters (**=, >>=, <<=) which was written byThomas Wouters2000-08-241-753/+805
| | | | | Michael Hudson, and support in general for the augmented assignment syntax. The graminit.c patch is large!
* require list comprehensions to start with a for clauseSkip Montanaro2000-08-221-5/+5
|
* PEP 214, Extended print Statement, has been accepted by the BDFL.Barry Warsaw2000-08-211-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.
* Apply SF patch #101135, adding 'import module as m' and 'from module importThomas Wouters2000-08-171-640/+684
| | | | | | | | 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.
* list comprehensions. seeSkip Montanaro2000-08-121-201/+296
| | | | | | http://sourceforge.net/patch/?func=detailpatch&patch_id=100654&group_id=5470 for details.
* slightly modified version of Greg Ewing's extended call syntax patchJeremy Hylton2000-03-281-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
* Make first raise argument optionalGuido van Rossum1998-04-091-2/+3
|
* Oops, missed some renamings.Guido van Rossum1997-05-071-1/+1
|
* OK, ready to make 'assert' a keyword (instead of '__assert__').Guido van Rossum1997-04-161-1/+1
|
* Added assert grammar.Guido van Rossum1997-04-021-494/+522
|
* Disable support for access statementGuido van Rossum1996-08-121-587/+535
|
* Changes for slice and ellipsesGuido van Rossum1996-07-301-103/+144
|
* changes for power (**) operatorGuido van Rossum1996-01-121-325/+359
|
* new grammarGuido van Rossum1995-07-071-74/+142
|
* Grammar changedGuido van Rossum1995-01-071-466/+480
|
* Merge back to main trunkGuido van Rossum1994-08-301-78/+94
|
* change syntactical position of lambdef (was an atom, now is a test)Guido van Rossum1993-11-301-73/+81
|
* * import.c (get_module): pass .py filename to parse_file, not .pyc filename!Guido van Rossum1993-11-301-625/+627
| | | | | | | | | | | * 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.
* Committing the correct graminit.c; also changed confusing comments in Grammar.Guido van Rossum1993-10-271-717/+700
|
* * compile.[ch]: support for lambda()Guido van Rossum1993-10-261-678/+704
| | | | | | | | | | * 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!!!)
* * bltinmodule.c: removed exec() built-in function.Guido van Rossum1993-10-181-398/+435
| | | | | | | * 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.
* * Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.Guido van Rossum1993-06-171-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().
* Several changes in one:Guido van Rossum1993-05-191-492/+490
| | | | | | | | | | | | | | | | (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.)
* Latest gramamrGuido van Rossum1992-04-061-132/+130
|
* tightened try statement syntaxGuido van Rossum1992-03-311-10/+22
|
* *** empty log message ***Guido van Rossum1992-03-241-605/+703
|
* New grammar (semicolons, continue, no multiple NEWLINES)Guido van Rossum1991-07-271-538/+577
|
* Added copyright notice.Guido van Rossum1991-02-191-0/+24
|
* "Compiling" versionGuido van Rossum1990-12-201-1/+1
|
* removed dir statement. Function arguments may now be tests.Guido van Rossum1990-10-261-487/+463
|
* Initial revisionGuido van Rossum1990-10-141-0/+1094