summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_range.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45030: Fix integer overflow in __reduce__ of the range iterator (GH-28000)Serhiy Storchaka2021-09-041-2/+8
| | | | It happened with fast range iterator when the calculated stop = start + step * len was out of the C long range.
* bpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938)chilaxan2021-08-271-16/+31
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-40792: Make the result of PyNumber_Index() always having exact type int. ↵Serhiy Storchaka2020-05-281-0/+6
| | | | | | | | | | | | (GH-20443) Previously, the result could have been an instance of a subclass of int. Also revert bpo-26202 and make attributes start, stop and step of the range object having exact type int. Add private function _PyNumber_Index() which preserves the old behavior of PyNumber_Index() for performance to use it in the conversion functions like PyLong_AsLong().
* bpo-39200: Correct the error message for range() empty constructor (GH-17813)Pablo Galindo2020-01-051-0/+13
| | | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-37685: Use singletons ALWAYS_EQ and NEVER_EQ in more tests. (GH-15167)Serhiy Storchaka2019-08-081-13/+4
|
* bpo-35133: Fix mistakes when concatenate string literals on different lines. ↵Serhiy Storchaka2018-11-051-1/+1
| | | | | | | | | | (GH-10284) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.
* bpo-28876: bool of large range raises OverflowError (#699)4kir42017-03-201-4/+13
|
* Issue #28376: Creating instances of range_iterator by calling range_iteratorSerhiy Storchaka2016-10-081-31/+6
| | | | | type now is disallowed. Calling iter() on range instance is the only way. Patch by Oren Milman.
* Issue #28376: Creating instances of range_iterator by calling range_iteratorSerhiy Storchaka2016-10-081-23/+26
| | | | type now is deprecated. Patch by Oren Milman.
* Merge from 3.5.Serhiy Storchaka2016-10-081-0/+30
|\
| * Issue #28376: The constructor of range_iterator now checks that step is not 0.Serhiy Storchaka2016-10-081-0/+29
| | | | | | | | Patch by Oren Milman.
* | Remove unused support.run_unittest imports.Serhiy Storchaka2016-04-241-1/+1
|/ | | | It is not needed since tests use unittest.main().
* Issue #21741: Update 147 test modules to use test discovery.Zachary Ware2015-04-131-4/+1
| | | | | | | I have compared output between pre- and post-patch runs of these tests to make sure there's nothing missing and nothing broken, on both Windows and Linux. The only differences I found were actually tests that were previously *not* run.
* Issue #22777: Test pickling with all protocols.Serhiy Storchaka2014-12-151-22/+24
|
* Make the various iterators' "setstate" sliently and consistently clip theKristján Valur Jónsson2014-03-051-0/+12
|\ | | | | | | | | 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-0/+12
| | | | | | | | | | index. This avoids the possibility of setting an iterator to an invalid state.
* | Merge with 3.3Kristján Valur Jónsson2014-03-041-0/+12
|\ \ | |/
| * Fix pickling of rangeiter. rangeiter_setstate would not allow setting itKristján Valur Jónsson2014-03-041-0/+12
| | | | | | | | to the exhausted state.
* | Fix writing out 64-bit size fields on 32-bit buildsAntoine Pitrou2013-11-231-3/+4
| |
* | Issue #16402: Merge fix from 3.3Mark Dickinson2012-11-041-0/+9
|\ \ | |/
| * Issue #16402: Merge fix from 3.2Mark Dickinson2012-11-041-0/+9
| |\ |/ /
| * Issue #16402: In range slicing, fix shadowing of exceptions from __index__ ↵Mark Dickinson2012-11-041-0/+9
| | | | | | | | method.
* | Issue #14288: Serialization support for builtin iterators.Kristján Valur Jónsson2012-04-031-1/+23
| |
* | add introspection to range objects (closes #9896)Benjamin Peterson2011-11-051-0/+29
| | | | | | | | Patch by Daniel Urban.
* | Issue #13201: equality for range objects is now based on equality of the ↵Mark Dickinson2011-10-231-0/+52
|/ | | | underlying sequences. Thanks Sven Marnach for the patch.
* #11845: Fix typo in rangeobject.c that caused a crash in ↵Ezio Melotti2011-04-151-0/+9
| | | | compute_slice_indices. Patch by Daniel Urban.
* Issue 10889: Support slicing and indexing of large ranges (no docs changes, ↵Nick Coghlan2011-01-121-7/+86
| | | | since, as far as I know, we never said anywhere that this *didn't* work)
* Issue 2690: Add support for slicing and negative indices to range objects ↵Nick Coghlan2010-12-031-1/+72
| | | | | | (includes precalculation and storage of the range length). Refer to the tracker issue for the language moratorium implications of this change
* fix two broken testsBenjamin Peterson2010-11-201-1/+2
|
* merge all range tests into test_rangeBenjamin Peterson2010-11-201-0/+157
|
* #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-2/+2
|
* use assert[Not]In where appropriateEzio Melotti2010-01-231-12/+12
|
* use assert[Not]In where appropriateBenjamin Peterson2010-01-191-20/+20
| | | | A patch from Dave Malcolm.
* remove 2.x specific warningsBenjamin Peterson2009-11-161-4/+0
|
* Issue #7298: Fix a variety of problems leading to wrong results withMark Dickinson2009-11-151-0/+61
| | | | | | | the fast versions of range.__reversed__ and range iteration. Also fix wrong results and a refleak for PyLong version of range.__reversed__. Thanks Eric Smith for reviewing, and for suggesting improved tests.
* Issue #1766304: The range.__contains__ optimization should only beMark Dickinson2009-09-241-0/+6
| | | | applied to ints, not to instances of subclasses of int.
* Issue #1766304: Optimize membership testing for ranges: 'n in range(...)'Mark Dickinson2009-09-221-0/+50
| | | | | does an O(1) check, if n is an integer. Non-integers aren't affected. Thanks Robert Lehmann.
* convert old fail* assertions to assert*Benjamin Peterson2009-06-301-6/+6
|
* Fix SystemError and a wasps nest of ref counting issues.Raymond Hettinger2009-06-121-0/+7
|
* Issue #4183: Some tests didn't run with pickle.HIGHEST_PROTOCOL.Hirokazu Yamamoto2008-10-231-1/+1
| | | | Reviewed by Benjamin Peterson.
* Issue 2582: Fix pickling of range objects.Alexandre Vassalotti2008-06-101-0/+10
|
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-2/+2
|
* Removed PyInt_GetMax and sys.maxintChristian Heimes2007-12-041-3/+3
| | | | | I replaced sys.maxint with sys.maxsize in Lib/*.py. Does anybody see a problem with the change on Win 64bit platforms? Win 64's long is just 32bit but the sys.maxsize is now 2**63-1 on every 64bit platform. Also added docs for sys.maxsize.
* Update name of test.Walter Dörwald2007-05-211-1/+1
|
* Rename test_xrange.py to test_range.py and fix theWalter Dörwald2007-05-211-0/+68
type name in various spots.