From 4ad94210d1b8477b0cb7a4bca2f39dc385ab21a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Walter=20D=C3=B6rwald?= Date: Mon, 21 May 2007 18:01:17 +0000 Subject: [PATCH] Rename test_xrange.py to test_range.py and fix the type name in various spots. --- Include/rangeobject.h | 3 --- Lib/test/{test_xrange.py => test_range.py} | 4 ++-- Objects/rangeobject.c | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) rename Lib/test/{test_xrange.py => test_range.py} (97%) diff --git a/Include/rangeobject.h b/Include/rangeobject.h index 359bcb69f5b..847da80b89c 100644 --- a/Include/rangeobject.h +++ b/Include/rangeobject.h @@ -7,9 +7,6 @@ extern "C" { #endif -/* This is about the type 'xrange', not the built-in function range(), which - returns regular lists. */ - /* A range object represents an integer range. This is an immutable object; a range cannot change its value after creation. diff --git a/Lib/test/test_xrange.py b/Lib/test/test_range.py similarity index 97% rename from Lib/test/test_xrange.py rename to Lib/test/test_range.py index 3a5adf2b760..65433d4fab7 100644 --- a/Lib/test/test_xrange.py +++ b/Lib/test/test_range.py @@ -7,8 +7,8 @@ import warnings warnings.filterwarnings("ignore", "integer argument expected", DeprecationWarning, "unittest") -class XrangeTest(unittest.TestCase): - def test_xrange(self): +class RangeTest(unittest.TestCase): + def test_range(self): self.assertEqual(list(range(3)), [0, 1, 2]) self.assertEqual(list(range(1, 5)), [1, 2, 3, 4]) self.assertEqual(list(range(0)), []) diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 4a45212dbe8..8cefe672200 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -214,7 +214,7 @@ range_item(rangeobject *r, Py_ssize_t i) if (i < 0 || i >= len) { if (!PyErr_Occurred()) PyErr_SetString(PyExc_IndexError, - "xrange object index out of range"); + "range object index out of range"); return NULL; } @@ -313,7 +313,7 @@ PyTypeObject PyRange_Type = { range_new, /* tp_new */ }; -/*********************** Xrange Iterator **************************/ +/*********************** range Iterator **************************/ /* There are 2 types of iterators, one for C longs, the other for Python longs (ie, PyObjects). This should make iteration fast