Guido van Rossum | 12d12c5 | 1993-10-26 17:58:25 +0000 | [diff] [blame] | 1 | |
| 2 | /* Range object interface */ |
| 3 | |
Martin v. Löwis | 3d10b34 | 2001-06-05 05:58:44 +0000 | [diff] [blame] | 4 | #ifndef Py_RANGEOBJECT_H |
| 5 | #define Py_RANGEOBJECT_H |
| 6 | #ifdef __cplusplus |
| 7 | extern "C" { |
| 8 | #endif |
| 9 | |
Armin Rigo | 89a3946 | 2004-10-28 16:32:00 +0000 | [diff] [blame] | 10 | /* This is about the type 'xrange', not the built-in function range(), which |
| 11 | returns regular lists. */ |
| 12 | |
Guido van Rossum | 12d12c5 | 1993-10-26 17:58:25 +0000 | [diff] [blame] | 13 | /* |
Guido van Rossum | 9381782 | 1995-01-17 16:01:01 +0000 | [diff] [blame] | 14 | A range object represents an integer range. This is an immutable object; |
Guido van Rossum | 12d12c5 | 1993-10-26 17:58:25 +0000 | [diff] [blame] | 15 | a range cannot change its value after creation. |
| 16 | |
| 17 | Range objects behave like the corresponding tuple objects except that |
| 18 | they are represented by a start, stop, and step datamembers. |
| 19 | */ |
| 20 | |
Mark Hammond | 91a681d | 2002-08-12 07:21:58 +0000 | [diff] [blame] | 21 | PyAPI_DATA(PyTypeObject) PyRange_Type; |
Guido van Rossum | 12d12c5 | 1993-10-26 17:58:25 +0000 | [diff] [blame] | 22 | |
Martin v. Löwis | 6819210 | 2007-07-21 06:55:02 +0000 | [diff] [blame] | 23 | #define PyRange_Check(op) (Py_Type(op) == &PyRange_Type) |
Guido van Rossum | 12d12c5 | 1993-10-26 17:58:25 +0000 | [diff] [blame] | 24 | |
Martin v. Löwis | 3d10b34 | 2001-06-05 05:58:44 +0000 | [diff] [blame] | 25 | #ifdef __cplusplus |
| 26 | } |
| 27 | #endif |
| 28 | #endif /* !Py_RANGEOBJECT_H */ |