summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-30074: Fix compile warnings of _PySlice_Unpack and convert missed (#1154)Serhiy Storchaka2017-04-151-2/+2
| | | | PySlice_GetIndicesEx in _ctypes.c.
* bpo-27867: Expand the PySlice_GetIndicesEx macro. (#1023) (#1046)Serhiy Storchaka2017-04-081-4/+6
| | | | (cherry picked from commit b879fe8)
* bpo-29935: Fixed error messages in the index() method of tuple and list ↵Serhiy Storchaka2017-03-301-2/+2
| | | | | | | (#887) (#907) (#910) when pass indices of wrong type. (cherry picked from commit d4edfc9abffca965e76ebc5957a92031a4d6c4d4) (cherry picked from commit bf4bb2e43030661e568d5d4b046e8b9351cc164c)
* make sure to not call memcpy with a NULL second argumentBenjamin Peterson2016-09-071-6/+9
|
* Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-7/+13
| | | | | Affected classes are generic sequence iterators, iterators of bytearray, list, tuple, set, frozenset, dict, OrderedDict and corresponding views.
* Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka2015-12-191-1/+1
| | | | | This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
* fix merge_collapse to actually maintain the invariant it purports to (closes ↵Benjamin Peterson2015-02-251-1/+2
| | | | | | | | #23515) See de Gouw, Stijn and Rot, Jurriaan and de Boer, Frank S and Bubel, Richard and Hähnle, Reiner "OpenJDK’s java.utils.Collection.sort() is broken: The good, the bad and the worst case"
* 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.