Guido van Rossum
c00a938be8
OKOK, Greg's right, I should've used the :name option in the argument
...
format strings.
2000-02-24 21:48:29 +00:00
Guido van Rossum
4aa24f9979
Made all list methods use PyArg_ParseTuple(), for more accurate
...
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.
2000-02-24 15:23:03 +00:00
Guido van Rossum
bffd683f73
The rest of the changes by Trent Mick and Dale Nagata for warning-free
...
compilation on NT Alpha. Mostly added casts etc.
2000-01-20 22:32:56 +00:00
Guido van Rossum
fa71701d46
When deallocating a list, DECREF the items from the end back to the start.
1999-06-09 15:19:34 +00:00
Guido van Rossum
9bcd1d7931
Improve text of some error messages, as suggested by Sean Reifschneider.
1999-04-19 17:44:39 +00:00
Guido van Rossum
3aa23fdd47
Jim Ahlstrom patch: cutoff should be a long for machines with 16-bit
...
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.)
1999-01-14 19:01:53 +00:00
Barry Warsaw
dedf6d6804
listextend(): New method which implements L.extend(L2).
1998-10-09 16:37:25 +00:00
Guido van Rossum
2ccaf6f2f9
Remove a redundant check from list_slice() and list_ass_slice().
...
Noted by Greg Stein.
1998-10-07 13:24:13 +00:00
Guido van Rossum
3dd7f3fef0
Added doc strings for methods and a new pop() method.
1998-06-30 15:36:32 +00:00
Guido van Rossum
4281258b5f
Minor cleanup by Tim after my changes:
...
+ 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.
1998-06-17 14:15:44 +00:00
Guido van Rossum
4c4e7df755
Tim's latest, with some of my changes (also a TP suggestion) added:
...
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.)
1998-06-16 15:18:28 +00:00
Guido van Rossum
a119c0dd5e
Tim's revision of the previous patch. He also added some sparts to
...
the median-of-three code to get a few percent back.
1998-05-29 17:56:32 +00:00
Guido van Rossum
ae621ff7b7
Guard against changes in the list size during a compare or sort.
1998-05-28 20:18:46 +00:00
Guido van Rossum
9be628338d
Tim's quicksort on May 25.
1998-05-26 15:06:32 +00:00
Guido van Rossum
ed7adcff73
Tim's quicksort on May 13.
1998-05-13 21:21:24 +00:00
Guido van Rossum
b7057640d1
Tim's quicksort on May 10.
1998-05-13 21:20:49 +00:00
Guido van Rossum
e32907df67
Get rid of the unused ifdefed-out old sort code.
1998-04-28 17:54:03 +00:00
Guido van Rossum
82e6a8f80d
Quicksort retuned by Tim Peters.
1998-04-28 13:17:56 +00:00
Guido van Rossum
fb376dee55
Use Py_Repr{Enter,Leave} to display recursive lists in finite space.
...
(Jeremy will hardly recognize his patch :-)
1998-04-10 22:47:27 +00:00
Guido van Rossum
044b9dc1d7
Add back some safeguards on the index elements that were lost in the
...
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)
1998-02-25 17:50:03 +00:00
Guido van Rossum
24e62e2c7c
Modified quicksort by Raymund Galvin, after studying the GNU libg++
...
quicksort. This should be much faster if there are lots of
duplicates, and otherwise at least as good.
1997-12-10 15:14:24 +00:00
Guido van Rossum
a27d112213
Rename roundup() to roundupsize(), as there's a macro roundup() in the
...
sys/types.h header on many systems that may get pulled in (through
WANT_SIGFPE_HANDLER which pulls in signal.h).
1997-08-25 18:36:23 +00:00
Guido van Rossum
5d8123f34a
Reordered list of methods to hopefully put the most frequently used
...
ones near the front.
1997-07-13 03:58:01 +00:00
Guido van Rossum
c8b6df9004
PyObject_Compare can raise an exception now.
1997-05-23 00:06:51 +00:00
Guido van Rossum
c0b618a2cc
Quickly renamed the last directory.
1997-05-02 03:12:38 +00:00