summaryrefslogtreecommitdiff
path: root/Objects/rangeobject.c
AgeCommit message (Collapse)AuthorLines
2012-11-04Issue #16402: In range slicing, fix shadowing of exceptions from __index__ ↵Mark Dickinson-5/+5
method.
2012-10-07Issue #14783: Improve int() docstring and also str(), range(), and slice().Chris Jerdonek-1/+2
This commit rewrites the docstring for int() to incorporate the documentation changes made in issue #16036. It also switches the docstrings for int(), str(), range(), and slice() to use multi-line signatures.
2012-05-16Issue #14829: Fix bisect and range() indexing with large indices (>= 2 ** ↵Antoine Pitrou-1/+1
32) under 64-bit Windows.
2011-04-15#11845: Fix typo in rangeobject.c that caused a crash in ↵Ezio Melotti-1/+1
compute_slice_indices. Patch by Daniel Urban.
2011-01-16rangeobject.c (compute_slice_indices): Make function static.Matthias Klose-1/+1
2011-01-13plug reference leakBenjamin Peterson-2/+4
2011-01-12Issue 10889: Support slicing and indexing of large ranges (no docs changes, ↵Nick Coghlan-67/+306
since, as far as I know, we never said anywhere that this *didn't* work)
2010-12-03Merge branches/pep-0384.Martin v. Löwis-3/+2
2010-12-03Issue 2690: Add support for slicing and negative indices to range objects ↵Nick Coghlan-100/+184
(includes precalculation and storage of the range length). Refer to the tracker issue for the language moratorium implications of this change
2010-11-20pep 7 actually wants the brace on a new lineBenjamin Peterson-22/+44
2010-11-20code style and simplificationBenjamin Peterson-72/+31
2010-11-20Add error handling in range_count.Georg Brandl-1/+4
2010-11-20count() should return integers #10474Benjamin Peterson-2/+2
2010-09-13Issue #9213: Add index and count methods to range objects, needed toDaniel Stutzbach-46/+129
meet the API of the collections.Sequence ABC.
2010-05-09Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou-127/+127
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. ........
2009-11-16fix one visible and several possible refleaks in rangeobject.cBenjamin Peterson-20/+17
In some cases, the code was just reordered to allow for less decrefing.
2009-11-15Fix another case of potential signed overflow.Mark Dickinson-1/+4
2009-11-15r76292 commit accidentally committed some extra code; remove itMark Dickinson-27/+0
2009-11-15Issue #7298: Fix a variety of problems leading to wrong results withMark Dickinson-55/+138
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.
2009-09-24Issue #1766304: The range.__contains__ optimization should only beMark Dickinson-1/+1
applied to ints, not to instances of subclasses of int.
2009-09-22Issue #1766304: Optimize membership testing for ranges: 'n in range(...)'Mark Dickinson-0/+57
does an O(1) check, if n is an integer. Non-integers aren't affected. Thanks Robert Lehmann.
2009-09-01#6814: remove traces of xrange().Georg Brandl-1/+1
2009-06-28Fix description of range_length_objMark Dickinson-4/+3
2009-06-24this is also no longer trueBenjamin Peterson-3/+3
2009-06-24fix commentBenjamin Peterson-5/+4
2009-06-24Issue #6334: Fix buggy internal length calculation in builtin range functionMark Dickinson-9/+2
2009-06-12Fix SystemError and a wasps nest of ref counting issues.Raymond Hettinger-8/+24
2009-02-02Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson-3/+3
type of tp_compare in a separate commit, for ease of reversion should things go wrong.
2009-02-01Issue #1717, stage 2: remove uses of tp_compare in Modules and mostMark Dickinson-6/+5
Objects.
2008-06-10Issue 2582: Fix pickling of range objects.Alexandre Vassalotti-0/+9
2008-04-25#2689 Fix indentation in Objects/rangeobject.cBenjamin Peterson-2/+2
2008-02-09Merge r60673Raymond Hettinger-1/+1
2007-12-20Drop _PyLong_FitsInLong. Fixes #1666.Martin v. Löwis-21/+36
2007-12-02Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases ↵Christian Heimes-6/+6
in intobject.h
2007-11-29Added all PyTypeObjects to the appropriate header files.Christian Heimes-6/+6
Before the patch a lot of internal types weren't available in the header files. The patch exposes the new iterators, views and some other types to all C modules. I've also renamed some of the types and tp_names.
2007-11-28Added view and iterator types to collections / _abcollChristian Heimes-1/+1
I've also renamed several of the iterators to keep a consistent naming schema.
2007-11-15Found another memory leak in longrangeiter. And redo the previous correctionAmaury Forgeot d'Arc-1/+2
without calling PyType_Ready(). Question 1: Should the interpreter register all types with PyType_Ready()? Many types seem to avoid it. Question 2: To reproduce the problem, run the following code: def f(): while True: for a in iter(range(0,1,10**20)): pass f() And watch the memory used by the process. How do we test this in a unittest?
2007-11-15Correct a memory leak: the range() object was not properly freed.Amaury Forgeot d'Arc-0/+1
2007-07-21Merged revisions 56467-56482 via svnmerge fromMartin v. Löwis-6/+3
svn+ssh://pythondev@svn.python.org/python/branches/p3yk ................ r56477 | martin.v.loewis | 2007-07-21 09:04:38 +0200 (Sa, 21 Jul 2007) | 11 lines Merged revisions 56466-56476 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r56476 | martin.v.loewis | 2007-07-21 08:55:02 +0200 (Sa, 21 Jul 2007) | 4 lines PEP 3123: Provide forward compatibility with Python 3.0, while keeping backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT. ........ ................ r56478 | martin.v.loewis | 2007-07-21 09:47:23 +0200 (Sa, 21 Jul 2007) | 2 lines PEP 3123: Use proper C inheritance for PyObject. ................ r56479 | martin.v.loewis | 2007-07-21 10:06:55 +0200 (Sa, 21 Jul 2007) | 3 lines Add longintrepr.h to Python.h, so that the compiler can see that PyFalse is really some kind of PyObject*. ................ r56480 | martin.v.loewis | 2007-07-21 10:47:18 +0200 (Sa, 21 Jul 2007) | 2 lines Qualify SHIFT, MASK, BASE. ................ r56482 | martin.v.loewis | 2007-07-21 19:10:57 +0200 (Sa, 21 Jul 2007) | 2 lines Correctly refer to _ob_next. ................
2007-05-21Rename test_xrange.py to test_range.py and fix theWalter Dörwald-2/+2
type name in various spots.
2007-05-21repr(range(10)) now returns 'range(0, 10)' for clarity.Walter Dörwald-10/+3
2007-05-20Change range_repr() to use %R for the start/stop/step attributes.Walter Dörwald-30/+6
2007-05-18Add functions PyUnicode_Append() and PyUnicode_AppendAndDel() that mirrorWalter Dörwald-9/+9
PyString_Concat() and PyString_ConcatAndDel() (the name PyUnicode_Concat() was already taken). Change PyObject_Repr() to always return a unicode object. Update all repr implementations to return unicode objects. Add a function PyObject_ReprStr8() that calls PyObject_Repr() and converts the result to an 8bit string. Use PyObject_ReprStr8() where using PyObject_Repr() can't be done straightforward.
2007-05-08Merged revisions 55180-55183 via svnmerge fromGuido van Rossum-8/+13
svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r55182 | neal.norwitz | 2007-05-07 23:03:06 -0700 (Mon, 07 May 2007) | 1 line Fix refleaks when using range with large values ........
2007-05-07Merged revisions 55007-55179 via svnmerge fromGuido van Rossum-141/+546
svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r55077 | guido.van.rossum | 2007-05-02 11:54:37 -0700 (Wed, 02 May 2007) | 2 lines Use the new print syntax, at least. ........ r55142 | fred.drake | 2007-05-04 21:27:30 -0700 (Fri, 04 May 2007) | 1 line remove old cruftiness ........ r55143 | fred.drake | 2007-05-04 21:52:16 -0700 (Fri, 04 May 2007) | 1 line make this work with the new Python ........ r55162 | neal.norwitz | 2007-05-06 22:29:18 -0700 (Sun, 06 May 2007) | 1 line Get asdl code gen working with Python 2.3. Should continue to work with 3.0 ........ r55164 | neal.norwitz | 2007-05-07 00:00:38 -0700 (Mon, 07 May 2007) | 1 line Verify checkins to p3yk (sic) branch go to 3000 list. ........ r55166 | neal.norwitz | 2007-05-07 00:12:35 -0700 (Mon, 07 May 2007) | 1 line Fix this test so it runs again by importing warnings_test properly. ........ r55167 | neal.norwitz | 2007-05-07 01:03:22 -0700 (Mon, 07 May 2007) | 8 lines So long xrange. range() now supports values that are outside -sys.maxint to sys.maxint. floats raise a TypeError. This has been sitting for a long time. It probably has some problems and needs cleanup. Objects/rangeobject.c now uses 4-space indents since it is almost completely new. ........ r55171 | guido.van.rossum | 2007-05-07 10:21:26 -0700 (Mon, 07 May 2007) | 4 lines Fix two tests that were previously depending on significant spaces at the end of a line (and before that on Python 2.x print behavior that has no exact equivalent in 3.0). ........
2006-04-21Merge p3yk branch with the trunk up to revision 45595. This breaks a fairThomas Wouters-92/+83
number of tests, all because of the codecs/_multibytecodecs issue described here (it's not a Py3K issue, just something Py3K discovers): http://mail.python.org/pipermail/python-dev/2006-April/064051.html Hye-Shik Chang promised to look for a fix, so no need to fix it here. The tests that are expected to break are: test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecs test_multibytecodec This merge fixes an actual test failure (test_weakref) in this branch, though, so I believe merging is the right thing to do anyway.
2006-02-15Merge ssize_t branch.Martin v. Löwis-7/+7
2006-02-11Renamed _length_cue() to __length_hint__(). See:Armin Rigo-2/+2
http://mail.python.org/pipermail/python-dev/2006-February/060524.html
2005-09-24Convert iterator __len__() methods to a private API.Raymond Hettinger-8/+10
2005-08-26Disallow keyword arguments for type constructors that don't use them.Georg Brandl-0/+3
(fixes bug #1119418)