| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing
a POP_TOP on each conditional and sometimes allows the peephole optimizer to
skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly.
|
|
|
|
| |
This shows a modest (1-3%) speed-up in templating systems, for example.
|
| |
|
|
|
|
|
| |
I changed some bytearray methods to use strings instead of unicode like bytes_repr
Also, bytearray.fromhex() can take strings as well as unicode
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
conversion to bool raises an exception, 'with' loses that exception.
Reviewed by Jeffrey Yasskin.
Already ported to 2.5, will port to 2.6 and 3.0
|
|
|
|
| |
"raised" without setting x, err, or why to let the eval loop know.
|
|
|
|
|
| |
whether any thread has tracing turned on, which saves one load instruction in
the fast_next_opcode path in PyEval_EvalFrameEx(). See issue 4477.
|
|
|
|
| |
(35% faster according to pybench)
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
whose write() method installs another sys.stdout.
Will backport.
|
|
|
|
|
|
|
| |
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
|
| |
|
| |
|
| |
|
|
|
|
| |
EOL 80 limit and supply more alternatives in warning messages.
|
|
|
|
| |
derive from BaseException.
|
|
|
|
|
| |
now don't warn for some corner cases that deserve a warning, rather
than warning double or incorrectly for some other corner cases.
|
|
|
|
| |
doesn't derive from BaseException.
|
|
|
|
| |
of in a temp variable (bumps the magic number for pyc files)
|
|
|
|
| |
ceval.c. This is worth about a .03-.04us speedup on a simple with block.
|
| |
|
| |
|
|
|
|
| |
Py_REFCNT. Macros for b/w compatibility are available.
|
|
|
|
|
|
|
|
|
|
|
| |
Allows dictionaries to be pre-sized (upto 255 elements) saving time lost
to re-sizes with their attendant mallocs and re-insertions.
Has zero effect on small dictionaries (5 elements or fewer), a slight
benefit for dicts upto 22 elements (because they had to resize once
anyway), and more benefit for dicts upto 255 elements (saving multiple
resizes during the build-up and reducing the number of collisions on
the first insertions). Beyond 255 elements, there is no addional benefit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New opcode, STORE_MAP saves the compiler from awkward stack manipulations
and specializes for dicts using PyDict_SetItem instead of PyObject_SetItem.
Old disassembly:
0 BUILD_MAP 0
3 DUP_TOP
4 LOAD_CONST 1 (1)
7 ROT_TWO
8 LOAD_CONST 2 ('x')
11 STORE_SUBSCR
12 DUP_TOP
13 LOAD_CONST 3 (2)
16 ROT_TWO
17 LOAD_CONST 4 ('y')
20 STORE_SUBSCR
New disassembly:
0 BUILD_MAP 0
3 LOAD_CONST 1 (1)
6 LOAD_CONST 2 ('x')
9 STORE_MAP
10 LOAD_CONST 3 (2)
13 LOAD_CONST 4 ('y')
16 STORE_MAP
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Correction for issue1265 (pdb bug with "with" statement).
When an unfinished generator-iterator is garbage collected, PyEval_EvalFrameEx
is called with a GeneratorExit exception set. This leads to funny results
if the sys.settrace function itself makes use of generators.
A visible effect is that the settrace function is reset to None.
Another is that the eventual "finally" block of the generator is not called.
It is necessary to save/restore the exception around the call to the trace
function.
This happens a lot with py3k: isinstance() of an ABCMeta instance runs
def __instancecheck__(cls, instance):
"""Override for isinstance(instance, cls)."""
return any(cls.__subclasscheck__(c)
for c in {instance.__class__, type(instance)})
which lets an opened generator expression each time it returns True.
Backport candidate, even if the case is less frequent in 2.5.
|
| |
|
|
|
|
| |
go (way) over, but those are harder to fix without suffering in readability.
|
| |
|
|
|
|
|
| |
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
|
| |
|
| |
|
|
|
|
| |
signed chars in frameobject.c which can occur with opcodes > 127
|
|
|
|
| |
masked by a generic one with the message "unpack non-sequence".
|
|
|
|
| |
sq_ass_slice instead of the sq_slice slot.
|
| |
|
| |
|
|
|
|
|
|
|
| |
I can't think of an easy way to test this behavior. It only occurs
when the file system default encoding and the interpreter default
encoding are different, such that you can open the file but not decode
its name.
|
|
|
|
|
|
|
| |
The next step of PEP 352 (for 2.6) causes raising a string exception to trigger
a TypeError. Trying to catch a string exception raises a DeprecationWarning.
References to string exceptions has been removed from the docs since they are
now just an error.
|
|
|
|
| |
the PREDICT macros.
|
|
|
|
| |
instead of just a dictionary. (backporting...)
|
|
|
|
|
|
|
| |
sys.callstats() match its docstring.
Backport candidate. Though it's an API change, this is a pretty obscure
portion of the API.
|
|
|
|
|
|
| |
Verify that PyEval_Get{Globals,Locals} returned valid pointers.
Klocwork 231-232
|