summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Accept None as start and stop parameters for list.index() and ↵Petri Lehtinen2011-11-061-11/+3
| | | | | | tuple.index()" Issue #13340.
* Accept None as start and stop parameters for list.index() and tuple.index()Petri Lehtinen2011-11-051-3/+11
| | | | Closes #13340.
* Backport issue #12973 list_repeat fix from 3.x.Mark Dickinson2011-09-191-3/+3
|
* #11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-161-1/+1
|
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-2249/+2249
|
* #8030: more docstring fix for builtin types.Ezio Melotti2010-02-281-1/+1
|
* #8030: make builtin type docstrings more consistent: use "iterable" instead ↵Georg Brandl2010-02-281-1/+1
| | | | of "seq(uence)", use "new" to show that set() always returns a new object.
* Silence some 'comparison between signed and unsigned' compiler warnings.Mark Dickinson2010-02-141-7/+8
|
* Issue #7788: Fix a crash produced by deleting a list slice with hugeMark Dickinson2010-01-291-1/+2
| | | | step value. Patch by Marcin Bachry.
* grant list.index() a more informative error message #7252Benjamin Peterson2009-11-021-2/+16
|
* prevent a rather unlikely segfaultBenjamin Peterson2009-11-021-2/+8
|
* Issue #7084: Fix a (very unlikely) crash when printing a list from oneAntoine Pitrou2009-10-111-1/+6
| | | | thread, and mutating it from another one. Patch by Scott Dial.
* Issue 1242657: list(obj) can swallow KeyboardInterrupt.Raymond Hettinger2009-02-021-0/+4
|
* Backport r67478Raymond Hettinger2008-12-031-8/+9
|
* Docstring changes: Specify exceptions raisedAndrew M. Kuchling2008-10-041-3/+6
|
* Issue 2235: __hash__ is once again inherited by default, but inheritance can ↵Nick Coghlan2008-07-151-1/+1
| | | | be blocked explicitly so that collections.Hashable remains meaningful
* Merge in release25-maint r60793:Gregory P. Smith2008-06-111-3/+19
| | | | | | Added checks for integer overflows, contributed by Google. Some are only available if asserts are left in the code, in cases where they can't be triggered from Python code.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-10/+10
| | | | | | | 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.
* Some style nits. Also clarify in the docstrings what __sizeof__ does.Georg Brandl2008-06-011-1/+1
|
* Issue #2898: Added sys.getsizeof() to retrieve size of objects in bytes.Robert Schuppenies2008-06-011-0/+12
|
* Renamed PyString to PyBytesChristian Heimes2008-05-261-10/+10
|
* A little reformating of Py3k warningsBenjamin Peterson2008-04-271-1/+1
|
* Use PyErr_WarnPy3k throughoutBenjamin Peterson2008-04-271-3/+1
|
* Make Py3k warnings consistent w.r.t. punctuation; also respect theGeorg Brandl2008-03-251-1/+1
| | | | EOL 80 limit and supply more alternatives in warning messages.
* Issue 2354: Fix-up compare warning. Patch contributed by Jeff Balogh.Raymond Hettinger2008-03-191-1/+1
|
* Issue: 2354: Add 3K warning for the cmp argument to list.sort() and sorted().Raymond Hettinger2008-03-181-0/+5
|
* Use PY_FORMAT_SIZE_T instead of z for string formatting. Thanks Neal.Christian Heimes2008-02-241-2/+4
|
* Use prefix decrementChristian Heimes2008-02-081-2/+1
|
* Added some statistics code to dict and list object code. I wanted to test ↵Christian Heimes2008-02-071-0/+29
| | | | how a larger freelist affects the reusage of freed objects. Contrary to my gut feelings 80 objects is more than fine for small apps. I haven't profiled a large app yet.
* Unified naming convention for free lists and their limits. All free listsChristian Heimes2008-02-061-11/+13
| | | | | | | | in Object/ are named ``free_list``, the counter ``numfree`` and the upper limit is a macro ``PyName_MAXFREELIST`` inside an #ifndef block. The chances should make it easier to adjust Python for platforms with less memory, e.g. mobile phones.
* Use the right (portable) definition of the max of a Py_ssize_t.Thomas Wouters2008-01-251-1/+1
|
* Rewrite the list_inline_repeat overflow check slightly differently.Guido van Rossum2008-01-251-6/+7
|
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-83/+83
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Optimize PyList_AsTuple(). Improve cache performance by doing theRaymond Hettinger2007-12-151-5/+5
| | | | | | pointer copy and object increment in one pass. For small lists, save the overhead of the call to memcpy() -- this comes up in calls like f(*listcomp).
* Fix Issue 1045.Raymond Hettinger2007-12-061-11/+1
| | | | | Factor-out common calling code by simplifying the length_hint API. Speed-up the function by caching the PyObject_String for the attribute lookup.
* merge -r59315:59316 from py3k: Fix issue #1553: An errornous __length_hint__ ↵Christian Heimes2007-12-051-2/+3
| | | | can make list() raise a SystemError
* Backport of _abccoll.py by Benjamin Arangueren, issue 1383.Guido van Rossum2007-11-221-9/+1
| | | | With some changes of my own thrown in (e.g. backport of r58107).
* Fix the overflow checking of list_repeat.Armin Rigo2007-10-171-4/+7
| | | | | | Introduce overflow checking into list_inplace_repeat. Backport candidate, possibly.
* Add a bunch of GIL release/acquire points in tp_print implementations and forBrett Cannon2007-09-171-1/+10
| | | | | | PyObject_Print(). Closes issue #1164.
* Fix a possible segfault from recursing too deep to get the repr of a list.Brett Cannon2007-09-101-0/+3
| | | | Closes issue #1096.
* Improve extended slicing support in builtin types and classes. Specifically:Thomas Wouters2007-08-281-13/+30
| | | | | | | | | | | | | | | | | | | | - Specialcase extended slices that amount to a shallow copy the same way as is done for simple slices, in the tuple, string and unicode case. - Specialcase step-1 extended slices to optimize the common case for all involved types. - For lists, allow extended slice assignment of differing lengths as long as the step is 1. (Previously, 'l[:2:1] = []' failed even though 'l[:2] = []' and 'l[:2:None] = []' do not.) - Implement extended slicing for buffer, array, structseq, mmap and UserString.UserString. - Implement slice-object support (but not non-step-1 slice assignment) for UserString.MutableString. - Add tests for all new functionality.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-92/+87
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Variation of patch # 1624059 to speed up checking if an object is a subclassNeal Norwitz2007-02-251-1/+1
| | | | | | | | | | | | | | | | | | of some of the common builtin types. Use a bit in tp_flags for each common builtin type. Check the bit to determine if any instance is a subclass of these common types. The check avoids a function call and O(n) search of the base classes. The check is done in the various Py*_Check macros rather than calling PyType_IsSubtype(). All the bits are set in tp_flags when the type is declared in the Objects/*object.c files because PyType_Ready() is not called for all the types. Should PyType_Ready() be called for all types? If so and the change is made, the changes to the Objects/*object.c files can be reverted (remove setting the tp_flags). Objects/typeobject.c would also have to be modified to add conditions for Py*_CheckExact() in addition to each the PyType_IsSubtype check.
* Patch [ 1586791 ] better error msgs for some TypeErrorsGeorg Brandl2006-11-191-6/+9
|
* Prevent crash if alloc of garbage fails. Found by Typo.pl.Neal Norwitz2006-10-281-0/+5
| | | | Will backport.
* Forward-port of r52136,52138: a review of overflow-detecting code.Armin Rigo2006-10-041-8/+3
| | | | | | | | | | | | | | | | | | | | | | | * unified the way intobject, longobject and mystrtoul handle values around -sys.maxint-1. * in general, trying to entierely avoid overflows in any computation involving signed ints or longs is extremely involved. Fixed a few simple cases where a compiler might be too clever (but that's all guesswork). * more overflow checks against bad data in marshal.c. * 2.5 specific: fixed a number of places that were still confusing int and Py_ssize_t. Some of them could potentially have caused "real-world" breakage. * list.pop(x): fixing overflow issues on x was messy. I just reverted to PyArg_ParseTuple("n"), which does the right thing. (An obscure test was trying to give a Decimal to list.pop()... doesn't make sense any more IMHO) * trying to write a few tests...
* Move initialization to after the asserts for non-NULL values.Neal Norwitz2006-08-191-2/+4
| | | | | | Klocwork 286-287. (I'm not backporting this, but if someone wants to, feel free.)
* Patch #1538606, Patch to fix __index__() clipping.Neal Norwitz2006-08-121-7/+5
| | | | | | | I modified this patch some by fixing style, some error checking, and adding XXX comments. This patch requires review and some changes are to be expected. I'm checking in now to get the greatest possible review and establish a baseline for moving forward. I don't want this to hold up release if possible.
* Check return of PyMem_MALLOC (garbage) is non-NULL.Neal Norwitz2006-08-121-2/+6
| | | | | | Check seq in both portions of if/else. Klocwork #289-290.
* Don't leak the list object if there's an error allocating the item storage. ↵Neal Norwitz2006-06-121-1/+3
| | | | Backport candidate