Daniel Stutzbach
9f0cbf1c72
Issue #9213 : Add index and count methods to range objects, needed to
...
meet the API of the collections.Sequence ABC.
2010-09-13 21:16:29 +00:00
Antoine Pitrou
f95a1b3c53
Recorded merge of revisions 81029 via svnmerge from
...
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.
........
2010-05-09 15:52:27 +00:00
Benjamin Peterson
36fbb730a7
fix one visible and several possible refleaks in rangeobject.c
...
In some cases, the code was just reordered to allow for less decrefing.
2009-11-16 00:34:25 +00:00
Mark Dickinson
b43dbc26f9
Fix another case of potential signed overflow.
2009-11-15 12:56:08 +00:00
Mark Dickinson
bde0508d75
r76292 commit accidentally committed some extra code; remove it
2009-11-15 10:04:50 +00:00
Mark Dickinson
d550c9a281
Issue #7298 : Fix a variety of problems leading to wrong results with
...
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-11-15 09:57:26 +00:00
Mark Dickinson
418f81d9b6
Issue #1766304 : The range.__contains__ optimization should only be
...
applied to ints, not to instances of subclasses of int.
2009-09-24 20:04:23 +00:00
Mark Dickinson
3e124ae739
Issue #1766304 : Optimize membership testing for ranges: 'n in range(...)'
...
does an O(1) check, if n is an integer. Non-integers aren't affected.
Thanks Robert Lehmann.
2009-09-22 21:47:24 +00:00
Georg Brandl
c9a5a0e165
#6814 : remove traces of xrange().
2009-09-01 07:34:27 +00:00
Mark Dickinson
732166df68
Fix description of range_length_obj
2009-06-28 22:08:40 +00:00
Benjamin Peterson
12792092a6
this is also no longer true
2009-06-24 22:16:41 +00:00
Benjamin Peterson
a47af9cf18
fix comment
2009-06-24 21:14:38 +00:00
Mark Dickinson
eb36d31bb8
Issue #6334 : Fix buggy internal length calculation in builtin range function
2009-06-24 18:36:46 +00:00
Raymond Hettinger
94f5583777
Fix SystemError and a wasps nest of ref counting issues.
2009-06-12 18:40:16 +00:00
Mark Dickinson
e94c679df0
Issue #1717 : rename tp_compare to tp_reserved. I'll change the
...
type of tp_compare in a separate commit, for ease of reversion
should things go wrong.
2009-02-02 20:36:42 +00:00
Mark Dickinson
211c625829
Issue #1717 , stage 2: remove uses of tp_compare in Modules and most
...
Objects.
2009-02-01 10:28:51 +00:00
Alexandre Vassalotti
7505607ae7
Issue 2582: Fix pickling of range objects.
2008-06-10 04:03:04 +00:00
Benjamin Peterson
df0a5cbb2c
#2689 Fix indentation in Objects/rangeobject.c
2008-04-25 21:15:37 +00:00
Raymond Hettinger
ad3f3321f6
Merge r60673
2008-02-09 04:13:49 +00:00
Martin v. Löwis
8445104d7d
Drop _PyLong_FitsInLong. Fixes #1666 .
2007-12-20 22:57:23 +00:00
Christian Heimes
217cfd1c86
Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases in intobject.h
2007-12-02 14:31:20 +00:00
Christian Heimes
a22e8bdfd9
Added all PyTypeObjects to the appropriate header files.
...
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-29 22:35:39 +00:00
Christian Heimes
f83be4e3f3
Added view and iterator types to collections / _abcoll
...
I've also renamed several of the iterators to keep a consistent naming schema.
2007-11-28 09:44:38 +00:00
Amaury Forgeot d'Arc
b7f17e4bb4
Found another memory leak in longrangeiter. And redo the previous correction
...
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-15 20:52:21 +00:00
Amaury Forgeot d'Arc
a1e9ec4e55
Correct a memory leak: the range() object was not properly freed.
2007-11-15 19:16:08 +00:00