Commit Graph

12 Commits

Author SHA1 Message Date
Ezio Melotti 2623a37852 Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line

  #9424: Replace deprecated assert* methods in the Python test suite.
........
2010-11-21 13:34:58 +00:00
Ezio Melotti aa98058cc4 use assert[Not]In where appropriate 2010-01-23 23:04:36 +00:00
Mark Dickinson 1b34d2552c Issue #5080: turn the DeprecationWarning from float arguments passed
to integer PyArg_Parse* format codes into a TypeError.  Add a
DeprecationWarning for floats passed with the 'L' format code, which
didn't previously have a warning.
2010-01-01 17:27:30 +00:00
Mark Dickinson 009ae861f2 Avoid signed overflow in some xrange calculations, and extend
xrange tests to cover some special cases that caused problems
in py3k.  This is a partial backport of r76292-76293 (see
issue #7298.)
2009-11-15 12:31:13 +00:00
Benjamin Peterson 5c8da86f3a convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
Hirokazu Yamamoto 592c275567 Issue #4183: Some tests didn't run with pickle.HIGHEST_PROTOCOL. 2008-10-23 00:37:33 +00:00
Alexandre Vassalotti 602d8db2bc Added better pickling support to xrange objects.
Cleaned up the unit test.
2008-06-10 04:01:23 +00:00
Alexandre Vassalotti 1f2f61a78f Issue 2582: Fix pickling of xrange objects. 2008-06-10 03:34:53 +00:00
Thomas Wouters f4d8f39053 Make xrange more Py_ssize_t aware, by assuming a Py_ssize_t is always at
least as big as a long. I believe this to be a safe assumption that is being
made in many parts of CPython, but a check could be added.

len(xrange(sys.maxint)) works now, so fix the testsuite's odd exception for
64-bit platforms too. It also fixes 'zip(xrange(sys.maxint), it)' as a
portable-ish (if expensive) alternative to enumerate(it); since zip() now
calls len(), this was breaking on (real) 64-bit platforms. No additional
test was added for that behaviour.
2006-04-04 17:28:12 +00:00
Neal Norwitz 64fa74df21 Get test to pass on amd64 (opteron). This is pretty hacky, but
rangeobject.c has an #ifdef that is reached only when LONG_MAX != INT_MAX
2004-10-14 03:46:18 +00:00
Tim Peters feec4533e2 Bug 1003935: xrange overflows
Added XXX comment about why the undocumented PyRange_New() API function
is too broken to be worth the considerable pain of repairing.

Changed range_new() to stop using PyRange_New().  This fixes a variety
of bogus errors.  Nothing in the core uses PyRange_New() now.

Documented that xrange() is intended to be simple and fast, and that
CPython restricts its arguments, and length of its result sequence, to
native C longs.

Added some tests that failed before the patch, and repaired a test that
relied on a bogus OverflowError getting raised.
2004-08-08 07:17:39 +00:00
Neal Norwitz 1c0423a2da Exercise xrange a bit 2004-07-08 01:59:55 +00:00