Skip to content

Commit cc89511

Browse files
committed
[GR-58526] add missing PyRange_Check
1 parent 86e9a3a commit cc89511

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

graalpython/com.oracle.graal.python.cext/include/Python.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2022, 2023, Oracle and/or its affiliates.
1+
/* Copyright (c) 2022, 2024, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2022 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -64,6 +64,7 @@ struct timeval;
6464
#include "boolobject.h"
6565
#include "floatobject.h"
6666
#include "complexobject.h"
67+
#include "rangeobject.h"
6768
#include "memoryobject.h"
6869
#include "tupleobject.h"
6970
#include "listobject.h"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates.
2+
* Copyright (C) 1996-2020 Python Software Foundation
3+
*
4+
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
5+
*/
6+
7+
/* Range object interface */
8+
9+
#ifndef Py_RANGEOBJECT_H
10+
#define Py_RANGEOBJECT_H
11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
15+
/*
16+
A range object represents an integer range. This is an immutable object;
17+
a range cannot change its value after creation.
18+
19+
Range objects behave like the corresponding tuple objects except that
20+
they are represented by a start, stop, and step datamembers.
21+
*/
22+
23+
PyAPI_DATA(PyTypeObject) PyRange_Type;
24+
PyAPI_DATA(PyTypeObject) PyRangeIter_Type;
25+
PyAPI_DATA(PyTypeObject) PyLongRangeIter_Type;
26+
27+
#define PyRange_Check(op) Py_IS_TYPE(op, &PyRange_Type)
28+
29+
#ifdef __cplusplus
30+
}
31+
#endif
32+
#endif /* !Py_RANGEOBJECT_H */

mx.graalpython/copyrights/overrides

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ graalpython/com.oracle.graal.python.cext/include/pystrtod.h,python.copyright
198198
graalpython/com.oracle.graal.python.cext/include/pythonrun.h,python.copyright
199199
graalpython/com.oracle.graal.python.cext/include/pythread.h,python.copyright
200200
graalpython/com.oracle.graal.python.cext/include/pytypedefs.h,python.copyright
201+
graalpython/com.oracle.graal.python.cext/include/rangeobject.h,python.copyright
201202
graalpython/com.oracle.graal.python.cext/include/setobject.h,python.copyright
202203
graalpython/com.oracle.graal.python.cext/include/sliceobject.h,python.copyright
203204
graalpython/com.oracle.graal.python.cext/include/structmember.h,python.copyright

0 commit comments

Comments
 (0)