| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Add definitions of INT_MAX and LONG_MAX to pyport.h.
Remove includes of limits.h and conditional definitions of INT_MAX
and LONG_MAX elsewhere.
This closes SourceForge patch #101659 and bug #115323.
|
|
|
|
| |
This should match the situation in the 1.6b1 tree.
|
|
|
|
|
| |
the list object supports this currently, but other candidates are
gladly accepted (like arraymodule and such.)
|
| |
|
|
|
|
| |
see: http://www.python.org/pipermail/python-dev/2000-August/014971.html
|
|
|
|
| |
Leave the actual #define in for API compatibility.
|
|
|
|
| |
free() the GC pointer, not the object pointer.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This patch modifies the type structures of objects that
participate in GC. The object's tp_basicsize is increased when
GC is enabled. GC information is prefixed to the object to
maintain binary compatibility. GC objects also define the
tp_flag Py_TPFLAGS_GC.
|
|
|
|
|
| |
This patch adds the type methods traverse and clear necessary for GC
implementation.
|
|
|
|
|
| |
this patch introduces PySequence_Fast and PySequence_Fast_GET_ITEM,
and modifies the list.extend method to accept any kind of sequence.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following patch adds "sq_contains" support to rangeobject, and enables
the already-written support for sq_contains in listobject and tupleobject.
The rangeobject "contains" code should be a bit more efficient than the
current default "in" implementation ;-) It might not get used much, but it's
not that much to add.
listobject.c and tupleobject.c already had code for sq_contains, and the
proper struct member was set, but the PyType structure was not extended to
include tp_flags, so the object-specific code was not getting called (Go
ahead, test it ;-). I also did this for the immutable_list_type in
listobject.c, eventhough it is probably never used. Symmetry and all that.
|
| |
|
|
|
|
|
| |
Removed PyErr_BadArgument() calls and replaced them with more useful
error messages.
|
|
|
|
|
|
|
|
|
|
| |
For more comments, read the patches@python.org archives.
For documentation read the comments in mymalloc.h and objimpl.h.
(This is not exactly what Vladimir posted to the patches list; I've
made a few changes, and Vladimir sent me a fix in private email for a
problem that only occurs in debug mode. I'm also holding back on his
change to main.c, which seems unnecessary to me.)
|
| |
|
|
|
|
|
|
|
|
| |
Added wrapping macros to dictobject.c, listobject.c, tupleobject.c,
frameobject.c, traceback.c that safely prevends core dumps
on stack overflow. Macros and functions in object.c, object.h.
The method is an "elevator destructor" that turns cascading
deletes into tail recursive behavior when some limit is hit.
|
|
|
|
|
| |
with a twist: you have to define NO_STRICT_LIST_APPEND manually
to enable multi-arg append().
|
|
|
|
| |
format strings.
|
|
|
|
|
|
|
|
| |
diagnostics.
*** INCOMPATIBLE CHANGE: This changes append(), remove(), index(), and
*** count() to require exactly one argument -- previously, multiple
*** arguments were silently assumed to be a tuple.
|
|
|
|
| |
compilation on NT Alpha. Mostly added casts etc.
|
| |
|
| |
|
|
|
|
|
|
| |
ints. (In theory, other variables should be widened to long as well,
but this won't ever be needed, since the len of a list is still an
int.)
|
| |
|
|
|
|
| |
Noted by Greg Stein.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
+ Took the "list" argument out of the other functions that no longer need
it. This speeds things up a little more.
+ Small comment changes in accord with that.
+ Exploited the now-safe ability to cache values in the partitioning loop.
Makes no timing difference on my flavor of Pentium, but this machine ran out
of registers 12 iterations ago. It should yield a small speedup on a RISC
machine, and not hurt in any case.
|
|
|
|
|
|
|
|
|
|
| |
instead of testing whether the list changed size after each
comparison, temporarily set the type of the list to an immutable list
type. This should allow continued use of the list for legitimate
purposes but disallows all operations that can change it in any way.
(Changes to the internals of list items are not caught, of cause;
that's not possible to detect, and it's not necessary to protect the
sort code, either.)
|
|
|
|
| |
the median-of-three code to get a few percent back.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
(Jeremy will hardly recognize his patch :-)
|
|
|
|
|
|
|
|
|
|
| |
last patch. Dave Ascher found a case that dumps core without these:
def myComparison(x,y):
return cmp(x%3,y%7)
z = range(12)
z.sort(myComparison)
|
|
|
|
|
| |
quicksort. This should be much faster if there are lots of
duplicates, and otherwise at least as good.
|
|
|
|
|
| |
sys/types.h header on many systems that may get pulled in (through
WANT_SIGFPE_HANDLER which pulls in signal.h).
|
|
|
|
| |
ones near the front.
|
| |
|
| |
|
| |
|
|
|
|
| |
integer overflow in << operator.
|