Open
Description
Python 2.6 syntax will be the base syntax, I'll list differences to other versions here:
Difference between 2.6 and 2.7.x:
- set literal syntax missing: Other Language Changes
- with statement changed: Other Language Changes
Difference between 2.6 and 3.4:
- Default source encoding changed from ASCII to UTF-8: The default source encoding is now UTF-8
- Non-ASCII letters are now allowed in identifiers.: PEP 3131: Non-ASCII letters are now allowed in identifiers.
- str changed to bytes and Unicode changed to str: Text Vs. Data Instead Of Unicode Vs. 8-bit
- print is a function: Print Is A Function
- new raise statement syntax: raise [expr [from expr]]: Changed Syntax
- True, False, and None are reserved words. (2.6 partially enforced the restrictions on None already.): Changed Syntax
- Change from except exc, var to except exc as var.: Changed Syntax
- List comprehensions no longer support the syntactic form [... for var in item1, item2, ...].: Changed Syntax
- New Metaclass Syntax.: Changed Syntax
- The ellipsis (...) can be used as an atomic expression anywhere. (Previously it was only allowed in slices.) Also, it must now be spelled as .... (Previously it could also be spelled as . . ., by a mere accident of the grammar.): Changed Syntax
- long renamed int no longer uses "L" affix : Integers
- Octal literals are no longer of the form 0720; use 0o720 instead. : Integers
- Function argument and return value annotations: PEP 3107: Function argument and return value annotations
- Keyword-only arguments: PEP 3102: Keyword-only arguments
- Keyword arguments are allowed after the list of base classes in a class definition: New Syntax
- nonlocal statement.: PEP 3104: nonlocal statement.
- Extended Iterable Unpacking: PEP 3132: Extended Iterable Unpacking
- Removed backticks (use repr() instead).: Removed Syntax
- Tuple parameter unpacking removed.: PEP 3113: Tuple parameter unpacking removed.
- Removed keyword: exec() is no longer a keyword: Removed Syntax
- The from module import * syntax is only allowed at the module level, no longer inside functions.: Removed Syntax
- The only acceptable syntax for relative imports is from .[module] import name. All import forms not starting with . are interpreted as absolute imports.: Removed Syntax
Auto generated syntax:
- BuiltinFunctions
- BuiltinExceptions
- Special names