summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #1621: Avoid signed overflow in list and tuple operationsMartin Panter2016-07-251-2/+2
| | | | Patch by Xiang Zhang.
* Issue #23034: The output of a special Python build with defined COUNT_ALLOCS,Serhiy Storchaka2016-07-031-0/+10
| | | | | | SHOW_ALLOC_COUNT or SHOW_TRACK_COUNT macros is now off by default. It can be re-enabled using the "-X showalloccount" option. It now outputs to stderr instead of stdout.
* Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-1/+1
|\
* \ Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-1/+1
|\ \ | |/ | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
| * Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-1/+1
| | | | | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
* | Issue #20440: Cleaning up the code by using Py_SETREF and Py_CLEAR.Serhiy Storchaka2015-12-271-4/+1
|/ | | | | Old code is correct, but with Py_SETREF and Py_CLEAR it can be cleaner. This patch doesn't fix bugs and hence there is no need to backport it.
* Issue #23629: Fix the default __sizeof__ implementation for variable-sized ↵Antoine Pitrou2015-03-101-12/+0
|\ | | | | | | objects.
| * Issue #23629: Fix the default __sizeof__ implementation for variable-sized ↵Antoine Pitrou2015-03-101-12/+0
| | | | | | | | objects.
* | Issue #22207: Fix "comparison between signed and unsigned integers" warning inVictor Stinner2014-08-171-1/+1
| | | | | | | | | | test checking for integer overflow on Py_ssize_t type: cast explicitly to size_t.
* | Issue #22077: Improve index error messages for bytearrays, bytes, lists, andTerry Jan Reedy2014-08-021-1/+1
|/ | | | | tuples by adding 'or slices'. Added ', not <typename' for bytearrays. Original patch by Claudiu Popa.
* Make the various iterators' "setstate" sliently and consistently clip theKristján Valur Jónsson2014-03-051-2/+2
|\ | | | | | | | | index. This avoids the possibility of setting an iterator to an invalid state.
| * Make the various iterators' "setstate" sliently and consistently clip theKristján Valur Jónsson2014-03-051-2/+2
| | | | | | | | | | index. This avoids the possibility of setting an iterator to an invalid state.
* | Issue #20437: Fixed 22 potential bugs when deleting objects references.Serhiy Storchaka2014-02-091-4/+2
|\ \ | |/
| * Issue #20437: Fixed 21 potential bugs when deleting objects references.Serhiy Storchaka2014-02-091-4/+2
| |
* | Issue #19513: repr(tuple) now uses _PyUnicodeWriter for better performancesVictor Stinner2013-11-191-27/+37
| |
* | Issue #18722: Remove uses of the "register" keyword in C code.Antoine Pitrou2013-08-131-24/+24
| |
* | Issue #9566: More long/Py_ssize_t fixes in tuple and list iterators (it_index)Victor Stinner2013-06-241-2/+2
| |
* | Issue #9566: Fix a compiler warning in tupleiter_setstate() on Windows x64Victor Stinner2013-06-241-1/+1
| |
* | Issuse #17932: Fix an integer overflow issue on Windows 64-bit in tupleVictor Stinner2013-06-041-1/+1
| | | | | | | | | | iterators: change the C type of tupleiterobject.it_index from long to Py_ssize_t.
* | Add a comment about *not* caching the hash value. Issue #9685 suggested to ↵Christian Heimes2013-01-071-0/+3
|/ | | | memorize the hash value, but the feature request was rejected because no speed ups were found.
* Fix the internals of our hash functions to used unsigned values during hashGregory P. Smith2012-12-111-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | computation as the overflow behavior of signed integers is undefined. NOTE: This change is smaller compared to 3.2 as much of this cleanup had already been done. I added the comment that my change in 3.2 added so that the code would match up. Otherwise this just adds or synchronizes appropriate UL designations on some constants to be pedantic. In practice we require compiling everything with -fwrapv which forces overflow to be defined as twos compliment but this keeps the code cleaner for checkers or in the case where someone has compiled it without -fwrapv or their compiler's equivalent. Found by Clang trunk's Undefined Behavior Sanitizer (UBSan). Cleanup only - no functionality or hash values change.
| * Fix the internals of our hash functions to used unsigned values during hashGregory P. Smith2012-12-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | computation as the overflow behavior of signed integers is undefined. In practice we require compiling everything with -fwrapv which forces overflow to be defined as twos compliment but this keeps the code cleaner for checkers or in the case where someone has compiled it without -fwrapv or their compiler's equivalent. Found by Clang trunk's Undefined Behavior Sanitizer (UBSan). Cleanup only - no functionality or hash values change.
* | Issue #16096: Fix several occurrences of potential signed integer overflow. ↵Mark Dickinson2012-10-061-8/+4
| | | | | | | | Thanks Serhiy Storchaka.
* | PyTuple_Pack() was missing va_end() in its error branch which lead to a ↵Christian Heimes2012-09-101-1/+3
|\ \ | |/ | | | | resource leak.
| * PyTuple_Pack() was missing va_end() in its error branch which lead to a ↵Christian Heimes2012-09-101-1/+3
| | | | | | | | resource leak.
* | Issue #14785: Add sys._debugmallocstats() to help debug low-level memory ↵David Malcolm2012-06-221-0/+16
| | | | | | | | allocation issues
* | Rename _PyIter_GetBuiltin to _PyObject_GetBuiltin, and do not include it in ↵Antoine Pitrou2012-04-041-2/+2
| | | | | | | | the stable ABI.
* | Issue #14288: Serialization support for builtin iterators.Kristján Valur Jónsson2012-04-031-0/+31
| |
* | Issue #14387: Do not include accu.h from Python.h.Antoine Pitrou2012-03-221-0/+1
|\ \ | |/
| * Issue #14387: Do not include accu.h from Python.h.Antoine Pitrou2012-03-221-0/+1
| |
* | Consolidate the occurrances of the prime used as the multiplier when hashing.Gregory P. Smith2012-01-141-1/+1
|\ \ | |/
| * Consolidate the occurrances of the prime used as the multiplier when hashingGregory P. Smith2012-01-141-1/+1
| | | | | | | | | | | | | | to a single #define instead of having several copies in several files. This excludes the Modules/ tree (datetime and expat both have a copy for their own purposes with no need for it to be the same).
* | Revert "Accept None as start and stop parameters for list.index() and ↵Petri Lehtinen2011-11-061-11/+4
|\ \ | |/ | | | | | | | | tuple.index()" Issue #13340.
| * Revert "Accept None as start and stop parameters for list.index() and ↵Petri Lehtinen2011-11-061-11/+4
| | | | | | | | | | | | tuple.index()" Issue #13340.
* | Accept None as start and stop parameters for list.index() and tuple.index().Petri Lehtinen2011-11-051-4/+11
|\ \ | |/ | | | | Closes #13340.
| * Accept None as start and stop parameters for list.index() and tuple.index()Petri Lehtinen2011-11-051-4/+11
| | | | | | | | Closes #13340.
* | Issue #12911: Fix memory consumption when calculating the repr() of huge ↵Antoine Pitrou2011-10-061-39/+36
|\ \ | |/ | | | | | | | | | | tuples or lists. This introduces a small private API for this common pattern. The issue has been discovered thanks to Martin's huge-mem buildbot.
| * Issue #12911: Fix memory consumption when calculating the repr() of huge ↵Antoine Pitrou2011-10-061-39/+36
| | | | | | | | | | | | | | tuples or lists. This introduces a small private API for this common pattern. The issue has been discovered thanks to Martin's huge-mem buildbot.
* | Issue #1621: Fix undefined behaviour in bytes.__hash__, str.__hash__, ↵Mark Dickinson2011-09-241-4/+5
| | | | | | | | tuple.__hash__, frozenset.__hash__ and set indexing operations.
* | Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.Brian Curtin2011-08-111-4/+2
| | | | | | | | The macro was introduced in #12724.
* | Issue #8914: fix various warnings from the Clang static analyzer v254.Brett Cannon2011-02-221-1/+1
|/
* Merge branches/pep-0384.Martin v. Löwis2010-12-031-1/+1
|
* follow up to #9778: define and use an unsigned hash typeBenjamin Peterson2010-10-231-2/+2
|
* make hashes always the size of pointers; introduce Py_hash_t #9778Benjamin Peterson2010-10-171-2/+2
|
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-736/+736
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Merged revisions 78515-78516,78522 via svnmerge fromEzio Melotti2010-03-011-4/+4
| | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78515 | georg.brandl | 2010-02-28 20:19:17 +0200 (Sun, 28 Feb 2010) | 1 line #8030: make builtin type docstrings more consistent: use "iterable" instead of "seq(uence)", use "new" to show that set() always returns a new object. ........ r78516 | georg.brandl | 2010-02-28 20:26:37 +0200 (Sun, 28 Feb 2010) | 1 line The set types can also be called without arguments. ........ r78522 | ezio.melotti | 2010-03-01 01:59:00 +0200 (Mon, 01 Mar 2010) | 1 line #8030: more docstring fix for builtin types. ........
* Merged revisions 76763 via svnmerge fromAntoine Pitrou2009-12-121-1/+2
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r76763 | antoine.pitrou | 2009-12-12 20:13:08 +0100 (sam., 12 déc. 2009) | 7 lines Issue #7466: segmentation fault when the garbage collector is called in the middle of populating a tuple. Patch by Florent Xicluna. (note: no NEWS entry for trunk since the bug was introduced in 2.7/3.1) ........
* Merged revisions 70550 via svnmerge fromAntoine Pitrou2009-03-231-3/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r70550 | antoine.pitrou | 2009-03-23 20:17:00 +0100 (lun., 23 mars 2009) | 3 lines The tracking statistics were actually too pessimistic ........
* Merged revisions 70546 via svnmerge fromAntoine Pitrou2009-03-231-0/+54
| | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r70546 | antoine.pitrou | 2009-03-23 19:41:45 +0100 (lun., 23 mars 2009) | 9 lines Issue #4688: Add a heuristic so that tuples and dicts containing only untrackable objects are not tracked by the garbage collector. This can reduce the size of collections and therefore the garbage collection overhead on long-running programs, depending on their particular use of datatypes. (trivia: this makes the "binary_trees" benchmark from the Computer Language Shootout 40% faster) ........
* Merged revisions ↵Benjamin Peterson2009-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 70342,70385-70387,70389-70390,70392-70393,70395,70400,70405-70406,70418,70438,70464,70468 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r70342 | georg.brandl | 2009-03-13 14:03:58 -0500 (Fri, 13 Mar 2009) | 1 line #5486: typos. ........ r70385 | benjamin.peterson | 2009-03-15 09:38:55 -0500 (Sun, 15 Mar 2009) | 1 line fix tuple.index() error message #5495 ........ r70386 | georg.brandl | 2009-03-15 16:32:06 -0500 (Sun, 15 Mar 2009) | 1 line #5496: fix docstring of lookup(). ........ r70387 | georg.brandl | 2009-03-15 16:37:16 -0500 (Sun, 15 Mar 2009) | 1 line #5493: clarify __nonzero__ docs. ........ r70389 | georg.brandl | 2009-03-15 16:43:38 -0500 (Sun, 15 Mar 2009) | 1 line Fix a small nit in the error message if bool() falls back on __len__ and it returns the wrong type: it would tell the user that __nonzero__ should return bool or int. ........ r70390 | georg.brandl | 2009-03-15 16:44:43 -0500 (Sun, 15 Mar 2009) | 1 line #5491: clarify nested() semantics. ........ r70392 | georg.brandl | 2009-03-15 16:46:00 -0500 (Sun, 15 Mar 2009) | 1 line #5488: add missing struct member. ........ r70393 | georg.brandl | 2009-03-15 16:47:42 -0500 (Sun, 15 Mar 2009) | 1 line #5478: fix copy-paste oversight in function signature. ........ r70395 | georg.brandl | 2009-03-15 16:51:48 -0500 (Sun, 15 Mar 2009) | 1 line #5276: document IDLESTARTUP and .Idle.py. ........ r70400 | georg.brandl | 2009-03-15 16:59:37 -0500 (Sun, 15 Mar 2009) | 3 lines Fix markup in re docs and give a mail address in regex howto, so that the recommendation to send suggestions to the author can be followed. ........ r70405 | georg.brandl | 2009-03-15 17:11:07 -0500 (Sun, 15 Mar 2009) | 7 lines Move the previously local import of threading to module level. This is cleaner and avoids lockups in obscure cases where a Queue is instantiated while the import lock is already held by another thread. OKed by Tim Peters. ........ r70406 | hirokazu.yamamoto | 2009-03-15 17:43:14 -0500 (Sun, 15 Mar 2009) | 1 line Added skip for old MSVC. ........ r70418 | georg.brandl | 2009-03-16 14:42:03 -0500 (Mon, 16 Mar 2009) | 1 line Add token markup. ........ r70438 | benjamin.peterson | 2009-03-17 15:29:51 -0500 (Tue, 17 Mar 2009) | 1 line I thought this was begging for an example ........ r70464 | benjamin.peterson | 2009-03-18 15:58:09 -0500 (Wed, 18 Mar 2009) | 1 line a much better example ........ r70468 | benjamin.peterson | 2009-03-18 22:04:31 -0500 (Wed, 18 Mar 2009) | 1 line close files after comparing them ........