]> granicus.if.org Git - python/commitdiff
Rename test_xrange.py to test_range.py and fix the
authorWalter Dörwald <walter@livinglogic.de>
Mon, 21 May 2007 18:01:17 +0000 (18:01 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Mon, 21 May 2007 18:01:17 +0000 (18:01 +0000)
type name in various spots.

Include/rangeobject.h
Lib/test/test_range.py [moved from Lib/test/test_xrange.py with 97% similarity]
Objects/rangeobject.c

index 359bcb69f5bcf6cb7a6dcb4121876962db804f1a..847da80b89c048fbd4cf44f565b9494bb7925b9b 100644 (file)
@@ -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.
similarity index 97%
rename from Lib/test/test_xrange.py
rename to Lib/test/test_range.py
index 3a5adf2b76052d6861f668568cce4ac92c0e7466..65433d4fab729e158da24e55da0eef7707f1c01f 100644 (file)
@@ -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)), [])
index 4a45212dbe807fae571a24593f71e8909387f29b..8cefe6722002f57612cea7750937159e3cf9722b 100644 (file)
@@ -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