summaryrefslogtreecommitdiff
path: root/Objects/tupleobject.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)Miss Islington (bot)2019-05-171-1/+2
| | | | | | | | | | The final addition (cur += step) may overflow, so use size_t for "cur". "cur" is always positive (even for negative steps), so it is safe to use size_t here. Co-Authored-By: Martin Panter <vadmium+py@gmail.com> (cherry picked from commit 14514d9084a40f599c57da853a305aa264562a43) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800)Miss Islington (bot)2018-02-211-1/+1
| | | | | (cherry picked from commit 745dc65b17b3936e3f9f4099f735f174d30c4e0c) Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
* [3.7] bpo-32746: Fix multiple typos (GH-5144) (GH-5520)Miss Islington (bot)2018-02-031-1/+1
| | | | | | Fix typos found by codespell in docs, docstrings, and comments. (cherry picked from commit c3d9508ff22ece9a96892b628dd5813e2fb0cd80) Co-authored-by: Leo Arias <leo.arias@canonical.com>
* bpo-32137: The repr of deeply nested dict now raises a RecursionError (#4570)Serhiy Storchaka2017-12-031-3/+0
| | | | | instead of crashing due to a stack overflow. This perhaps will fix similar problems in other extension types.
* bpo-32030: Add more options to _PyCoreConfig (#4485)Victor Stinner2017-11-201-8/+3
| | | | | | Py_Main() now handles two more -X options: * -X showrefcount: new _PyCoreConfig.show_ref_count field * -X showalloccount: new _PyCoreConfig.show_alloc_count field
* bpo-23699: Use a macro to reduce boilerplate code in rich comparison ↵stratakis2017-11-021-17/+1
| | | | functions (GH-793)
* bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow2017-09-071-0/+1
| | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
* Expand the PySlice_GetIndicesEx macro. (#1023)Serhiy Storchaka2017-04-081-3/+3
|
* bpo-29935: Fixed error messages in the index() method of tuple, list and ↵Serhiy Storchaka2017-03-301-3/+3
| | | | | deque (#887) when pass indices of wrong type.
* bpo-20186: Convert tuple object implementation to Argument Clinic. (#614)Serhiy Storchaka2017-03-191-46/+74
|
* bpo-29737: Optimize concatenating with empty tuple. (#524)Serhiy Storchaka2017-03-061-0/+8
|
* bpo-29695: Remove bad keyword parameters in int(), bool(), float(), list() ↵Serhiy Storchaka2017-03-061-8/+3
| | | | and tuple(). (#518)
* bpo-29695: Deprecated using bad named keyword arguments in builtings: (#486)Serhiy Storchaka2017-03-061-0/+6
| | | | int(), bool(), float(), list() and tuple(). Specify the value as a positional argument instead.
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-4/+2
| | | | possible. Patch is writen with Coccinelle.
* 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-051-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-101-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-101-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-051-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.