| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
deque_item(): a performance bug: the linked list of blocks was followed
from the left in most cases, because the test (i < (deque->len >> 1)) was
after "i %= BLOCKLEN".
deque_clear(): replaced a call to deque_len() with deque->len; not sure what
this call was here for, nor if all compilers under the sun would inline it.
deque_traverse(): I belive that it could be called by the GC when the deque
has leftblock==rightblock==NULL, because it is tracked before the first block
is allocated (though closely before). Still, a C extension module subclassing
deque could provide its own tp_alloc that could trigger a GC collection after
the PyObject_GC_Track()...
deque_richcompare(): rewrote to cleanly check for end-of-iterations instead of
relying on deque.__iter__().next() to succeed exactly len(deque) times -- an
assumption which can break if deques are subclassed. Added a test.
I wonder if the length should be explicitely bounded to INT_MAX, with
OverflowErrors, as in listobject.c. On 64-bit machines, adding more than
INT_MAX in the deque will result in trouble. (Note to anyone/me fixing
this: carefully check for overflows if len is close to INT_MAX in the
following functions: deque_rotate(), deque_item(), deque_ass_item())
|
| |
|
|
|
|
|
|
|
|
|
| |
The previous approach was too easily fooled (a rotate() sufficed).
* Use it->counter to determine when iteration is complete. The
previous approach was too complex.
* Strengthen an assertion and add a comment here or there.
|
| |
|
| |
|
|
|
|
|
|
| |
* Change the centering by one to make it possible to test the module
with BLOCKLEN's as low as two. Testing small blocks makes end-point
errors surface more readily.
|
|
|
|
|
| |
BLOCKLEN-1, this assert-failed in a debug build, or went wild with a
NULL pointer in a release build. Reported on c.l.py by Stefan Behnel.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* Have groupby() be careful about decreffing structure members.
|
|
|
|
| |
the htons() function.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Treat comparing a date to a datetime like a mixed-type comparison.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
decoding incomplete input (when the input stream is temporarily exhausted).
codecs.StreamReader now implements buffering, which enables proper
readline support for the UTF-16 decoders. codecs.StreamReader.read()
has a new argument chars which specifies the number of characters to
return. codecs.StreamReader.readline() and codecs.StreamReader.readlines()
have a new argument keepends. Trailing "\n"s will be stripped from the lines
if keepends is false. Added C APIs PyUnicode_DecodeUTF8Stateful and
PyUnicode_DecodeUTF16Stateful.
|
|
|
|
| |
compilation on Solaris 2.6, HP-UX 11, AIX 5.1 and (possibly) some IRIX versions.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Several functions adopted the strategy of altering a full lengthed
string copy and resizing afterwards. That would fail if the initial
string was short enough (0 or 1) to be interned. Interning precluded
the subsequent resizing operation.
The solution was to make sure the initial string was at least two
characters long.
Added tests to verify that all binascii functions do not crater when
given an empty string argument.
|
| |
|
|
|
|
| |
ignoring their transaction (txn) argument.
|
|
|
|
|
| |
empty final matches with finditer(). New test cases included
for this bug and for #581080.
|
|
|
|
| |
(Contributed by Dima Dorfman)
|
| |
|
| |
|
|
|
|
|
| |
"from blah import (foo, bar
baz, bongo)"
|
|
|
|
| |
don't.
|
|
|
|
| |
error msgs.
|
| |
|
|
|
|
| |
in first column, no parens around return value).
|
| |
|
|
|
|
| |
Made the constructor accept general iterables.
|
|
|
|
| |
"Fredrik Lund" who contributed the code in question).
|
| |
|
| |
|
|
|
|
|
| |
1.293, 1.298, and 1.300, which have tried to fix this for specific
platforms.
|
| |
|
|
|
|
|
| |
and a test case.
When booting a new thread, use the PyGILState API to manage the GIL.
|
|
|
|
|
| |
default famility is AF_UNIX if defined for the platform, otherwise the
default is AF_INET.
|
|
|
|
| |
in initsigs() inside pythonrun.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
truncate() left the stream position unchanged, which meant the
"truncated" data didn't go away:
>>> io.write('abc')
>>> io.truncate(0)
>>> io.write('xyz')
>>> io.getvalue()
'abcxyz'
Patch by Dima Dorfman.
|
| |
|
|
|
|
|
| |
found on legacy C compilers of HP-UX, IRIX and Tru64. (Reported
by roadkill, Richard Townsend, Maik Hertha and Minsik Kim)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ 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)
|