Martin v. Löwis
14f8b4cfcb
Patch #568124 : Add doc string macros.
2002-06-13 20:33:02 +00:00
Neal Norwitz
56f46f8d8c
Pyrangeiter_Type && range_iter should be static
2002-06-06 14:58:21 +00:00
Raymond Hettinger
c4c453f5ae
Skip Montanaro's patch, SF 559833, exposing xrange type in builtins.
...
Also, added more regression tests to cover the new type and test its
conformity with range().
2002-06-05 23:12:45 +00:00
Raymond Hettinger
48165d40cb
SF 564601 adding rangeiterobject to make xrange() iterate like range().
2002-06-05 20:08:48 +00:00
Raymond Hettinger
e53e7a2c7d
Inverted test for small speedup
2002-06-04 18:45:50 +00:00
Martin v. Löwis
e452659237
Patch #551410 : Implement tp_getiter.
2002-05-08 08:49:27 +00:00
Fred Drake
d9018323c0
Remove old deprecated features from the xrange object.
2002-05-02 19:56:55 +00:00
Fred Drake
edb51bb7e8
Fix attribute access for the xrange objects. The tp_getattr and tp_getattro
...
handlers were both set, but were not compatible. This change uses only the
tp_getattro handler with a more "modern" approach.
This fixes SF bug #551285 .
2002-05-02 16:05:27 +00:00
Neil Schemenauer
9acae5a0a6
Remove PyMalloc_New and PyMalloc_Del.
2002-04-12 02:44:55 +00:00
Neil Schemenauer
dcc819a5c9
Use pymalloc if it's enabled.
2002-03-22 15:33:15 +00:00
Neal Norwitz
2a47c0fa23
Fix spelling mistakes. Bugfix candidates.
2002-01-29 00:53:41 +00:00
Guido van Rossum
03b3f04542
long_mul(): The PyNumber_Multiply() call can return a long if the
...
result would overflow an int. Check for this. (SF bug #488482 , Armin
Rigo.)
2001-12-04 16:36:39 +00:00
Barry Warsaw
7ce3694a52
repr's converted to using PyString_FromFormat() instead of sprintf'ing
...
into a hardcoded char* buffer.
Closes patch #454743 .
2001-08-24 18:34:26 +00:00
Martin v. Löwis
e3eb1f2b23
Patch #427190 : Implement and use METH_NOARGS and METH_O.
2001-08-16 13:15:00 +00:00
Tim Peters
6d6c1a35e0
Merge of descr-branch back into trunk.
2001-08-02 04:15:00 +00:00
Thomas Wouters
efafcea280
Re-add 'advanced' xrange features, adding DeprecationWarnings as discussed
...
on python-dev. The features will still vanish, however, just one release
later.
2001-07-09 12:30:54 +00:00
Guido van Rossum
3f56166b1a
Rip out the fancy behaviors of xrange that nobody uses: repeat, slice,
...
contains, tolist(), and the start/stop/step attributes. This includes
removing the 4th ('repeat') argument to PyRange_New().
2001-07-05 13:27:48 +00:00
Guido van Rossum
65e0b99b61
SF patch #103158 by Greg Ball: Don't do unsafe arithmetic in xrange
...
object.
This fixes potential overflows in xrange()'s internal calculations on
64-bit platforms. The fix is complicated because the sq_length slot
function can only return an int; we want to support
xrange(sys.maxint), which is a 64-bit quantity on most 64-bit
platforms (except Win64). The solution is hacky but the best
possible: when the range is that long, we can use it in a for loop but
we can't ask for its length (nor can we actually iterate beyond
2**31-1, because the sq_item slot function has the same restrictions
on its arguments. Fixing those restrictions is a project for another
day...
2001-01-15 18:58:56 +00:00
Guido van Rossum
9e8f4ea0aa
Test for NULL returned from PyObject_NEW().
2000-12-14 14:59:53 +00:00
Fred Drake
0b796fa5c5
Fixed support for containment test when a negative step is used; this
...
*really* closes bug #121965 .
Added three attributes to the xrange object: start, stop, and step. These
are the same as for the slice objects.
2000-11-08 19:42:43 +00:00
Fred Drake
a91e1650aa
In the containment test, get the boundary condition right. ">" was used
...
where ">=" should have been.
This closes bug #121965 .
2000-11-08 18:37:05 +00:00
Guido van Rossum
8586991099
REMOVED all CWI, CNRI and BeOpen copyright markings.
...
This should match the situation in the 1.6b1 tree.
2000-09-01 23:29:29 +00:00
Tim Peters
72d421b75c
Boost buffer sizes in the absence of snprintf on Windows.
...
Ensure that # of args to sprintf always matches # of format specifiers.
2000-08-04 03:05:40 +00:00
Fred Drake
c76e0e5679
snprintf() is not portable, so continue to use sprintf() until a portable
...
snprintf() is available.
2000-08-04 02:34:41 +00:00
Fred Drake
2b83b4601f
Remove the tp_print handler.
...
Revise the tp_repr handler to produce a more "minimal" presentation.
Make the tolist() method use PyArg_ParseTuple() and provide a docstring.
2000-08-03 17:43:02 +00:00