Issue #28376: Creating instances of range_iterator by calling range_iterator
type now is deprecated. Patch by Oren Milman.
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index eb18611..8449fc7 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -930,6 +930,13 @@
{
long start, stop, step;
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "range_iterator(): creating instances of range_iterator "
+ "by calling range_iterator type is deprecated",
+ 1)) {
+ return NULL;
+ }
+
if (!_PyArg_NoKeywords("range_iterator()", kw)) {
return NULL;
}