Benjamin Peterson
70b224d8d4
assert than we never try to deal with True, False, or None as a name
13 years ago
Benjamin Peterson
442f20996d
create NameConstant AST class for None, True, and False literals ( closes #16619 )
13 years ago
Mark Dickinson
ded35aeb9d
Issue #16546 : make ast.YieldFrom argument mandatory.
13 years ago
Nick Coghlan
aab9c2b2ea
Issue #5765 : Apply a hard recursion limit in the compiler
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.
13 years ago
Meador Inge
996ae04943
remove unused variable
14 years ago
Meador Inge
0e3755e58a
remove unused variable
14 years ago
Benjamin Peterson
51ab2830bb
remove unused variable
14 years ago
Meador Inge
f69e24e3c6
Issue #15368 : fixing variable typo.
14 years ago
Meador Inge
b8a569065e
Issue #15368 : fixing variable typo.
14 years ago
Meador Inge
2ca6315d15
Issue #15368 : make bytecode generation deterministic.
14 years ago
Meador Inge
6642d1f97d
Issue #15368 : make bytecode generation deterministic.
14 years ago
Nick Coghlan
0b43bcf528
Close #14857 : fix regression in references to PEP 3135 implicit __class__ closure variable. Reopens issue #12370 , but also updates unittest.mock to workaround that issue
14 years ago
Victor Stinner
8f825060f1
Check newly created consistency using _PyUnicode_CheckConsistency(str, 1)
* In debug mode, fill the string data with invalid characters
* Simplify also reference counting in PyCodec_BackslashReplaceErrors()
and PyCodec_XMLCharRefReplaceError()
14 years ago
Benjamin Peterson
32c59b6fc1
mangle keyword-only argname when loading defaults ( closes #14607 )
14 years ago
Benjamin Peterson
2afe6aeae8
perform yield from delegation by repeating YIELD_FROM opcode ( closes #14230 )
This allows generators that are using yield from to be seen by debuggers. It
also kills the f_yieldfrom field on frame objects.
Patch mostly from Mark Shannon with a few tweaks by me.
14 years ago
Benjamin Peterson
527c622926
make YieldFrom its own distinct from Yield ( closes #13780 )
14 years ago
Nick Coghlan
1f7ce62bd6
Implement PEP 380 - 'yield from' ( closes #11682 )
14 years ago
Antoine Pitrou
86a36b500a
PEP 3155 / issue #13448 : Qualified name for classes and functions.
14 years ago
Benjamin Peterson
0c0d756098
don't let a tuple msg be interpreted as arguments to AssertionError ( closes #13268 )
14 years ago
Victor Stinner
6c7a52a46f
Check for PyUnicode_CopyCharacters() failure
14 years ago
Martin v. Löwis
d63a3b8beb
Implement PEP 393.
14 years ago
Benjamin Peterson
f5ff22329b
use a invalid name for the __class__ closure for super() ( closes #12370 )
This prevents the assignment of __class__ in the class body from breaking
super. (Although a determined person could do locals()["@__class__"] = 4)
15 years ago
Benjamin Peterson
43af12b0b4
unify TryExcept and TryFinally ( closes #12199 )
15 years ago
Benjamin Peterson
0a5dad9ef1
fix spacing
15 years ago
Benjamin Peterson
74897ba46f
fix indentation
15 years ago
Benjamin Peterson
bf1bbc1452
reflect with statements with multiple items in the AST ( closes #12106 )
15 years ago
Victor Stinner
4f2dab5c33
Revert my commit 7ba176c2f558: "Avoid useless "++" at the end of functions
Warnings found by the Clang Static Analyzer."
Most people prefer ++ at the end of functions.
15 years ago
Benjamin Peterson
43b068648e
try to use the same str object for all code filenames when compiling or unmarshalling ( #12190 )
This should reduce memory usage.
15 years ago
Victor Stinner
97e561ef24
Avoid useless "++" at the end of functions
Warnings found by the Clang Static Analyzer.
15 years ago
Victor Stinner
f3fd733f92
Remove useless argument of _PyUnicode_AsDefaultEncodedString()
15 years ago
Georg Brandl
8334fd9285
Add an "optimize" parameter to compile() to control the optimization level, and provide an interface to it in py_compile, compileall and PyZipFile.
15 years ago
Georg Brandl
e5b99f0fb3
Remove redundant includes of headers that are already included by Python.h.
15 years ago
Victor Stinner
15244f7b12
Recorded merge of revisions 85569-85570 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r85569 | victor.stinner | 2010-10-16 15:14:10 +0200 (sam., 16 oct. 2010) | 4 lines
Issue #9713 , #10114 : Parser functions (eg. PyParser_ASTFromFile) expects
filenames encoded to the filesystem encoding with surrogateescape error handler
(to support undecodable bytes), instead of UTF-8 in strict mode.
........
r85570 | victor.stinner | 2010-10-16 15:42:53 +0200 (sam., 16 oct. 2010) | 4 lines
Fix ast_error_finish() and err_input(): filename can be NULL
Fix my previous commit (r85569).
........
15 years ago
Victor Stinner
c049982ea5
compiler_error(): use PyUnicode_DecodeFSDefault() to decode the filename,
instead of utf-8 in strict mode.
15 years ago
Victor Stinner
4c7c8c3023
Issue #9713 , #10114 : Parser functions (eg. PyParser_ASTFromFile) expects
filenames encoded to the filesystem encoding with surrogateescape error handler
(to support undecodable bytes), instead of UTF-8 in strict mode.
15 years ago
Benjamin Peterson
d4efd9eb15
add column offset to all syntax errors
16 years ago
Amaury Forgeot d'Arc
ba117ef7e9
#4617 : Previously it was illegal to delete a name from the local
namespace if it occurs as a free variable in a nested block. This limitation
of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
This sample was valid in 2.6, but fails to compile in 3.x without this change::
>>> def f():
... def print_error():
... print(e)
... try:
... something
... except Exception as e:
... print_error()
... # implicit "del e" here
This sample has always been invalid in Python, and now works::
>>> def outer(x):
... def inner():
... return x
... inner()
... del x
There is no need to bump the PYC magic number: the new opcode is used
for code that did not compile before.
16 years ago
Antoine Pitrou
74a69fa662
Issue #9225 : Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced
by the new (and simpler) DUP_TOP_TWO. Performance isn't changed, but
our bytecode is a bit simplified. Patch by Demur Rumed.
16 years ago
Benjamin Peterson
20f9c3c50f
revert unintended changes
16 years ago
Benjamin Peterson
013783c529
move test_trace.py so as not to conflict with future tests for the trace module
16 years ago
Antoine Pitrou
252e8e2f61
Merged revisions 82171 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r82171 | antoine.pitrou | 2010-06-22 23:49:39 +0200 (mar., 22 juin 2010) | 10 lines
Merged revisions 82169 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r82169 | antoine.pitrou | 2010-06-22 23:42:05 +0200 (mar., 22 juin 2010) | 4 lines
Fix misindents in compile.c (for Benjamin).
Of course, whoever used the wrong indentation rules needs to be spanked.
........
................
16 years ago
Antoine Pitrou
9aee2c81ea
Merged revisions 82169 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r82169 | antoine.pitrou | 2010-06-22 23:42:05 +0200 (mar., 22 juin 2010) | 4 lines
Fix misindents in compile.c (for Benjamin).
Of course, whoever used the wrong indentation rules needs to be spanked.
........
16 years ago
Antoine Pitrou
c31616d558
Merged revisions 82169 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r82169 | antoine.pitrou | 2010-06-22 23:42:05 +0200 (mar., 22 juin 2010) | 4 lines
Fix misindents in compile.c (for Benjamin).
Of course, whoever used the wrong indentation rules needs to be spanked.
........
16 years ago
Antoine Pitrou
a4d36a9572
Fix misindents in compile.c (for Benjamin).
Of course, whoever used the wrong indentation rules needs to be spanked.
16 years ago
Victor Stinner
25bb0fdb67
Merged revisions 82059,82061 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r82059 | victor.stinner | 2010-06-18 01:08:50 +0200 (ven., 18 juin 2010) | 5 lines
Issue #6543 : Write the traceback in the terminal encoding instead of utf-8.
Fix the encoding of the modules filename.
Reindent also traceback.h, just because I hate tabs :-)
........
r82061 | victor.stinner | 2010-06-18 01:17:37 +0200 (ven., 18 juin 2010) | 2 lines
Issue #6543 : Mention the author of the patch, Amaury Forgeot d'Arc
........
16 years ago
Victor Stinner
0fe25a445d
Issue #6543 : Write the traceback in the terminal encoding instead of utf-8.
Fix the encoding of the modules filename.
Reindent also traceback.h, just because I hate tabs :-)
16 years ago
Antoine Pitrou
7f14f0d8a0
Recorded merge of revisions 81032 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines
Recorded merge of revisions 81029 via svnmerge from
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.
........
................
16 years ago
Antoine Pitrou
f95a1b3c53
Recorded merge of revisions 81029 via svnmerge from
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.
........
16 years ago
Antoine Pitrou
c7c96a90bc
Recorded merge of revisions 81029 via svnmerge from
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.
........
16 years ago
Antoine Pitrou
c83ea137d7
Untabify C files. Will watch buildbots.
16 years ago