summaryrefslogtreecommitdiffstats
path: root/Modules/itertoolsmodule.c
diff options
context:
space:
mode:
authorDavid Wolever <david@wolever.net>2008-03-19 02:35:45 (GMT)
committerDavid Wolever <david@wolever.net>2008-03-19 02:35:45 (GMT)
commit2724ab99c8c81cdb032372871d8f1eebb171ebe7 (patch)
tree536d452a552c67fc395e7049db451df5ee296eaa /Modules/itertoolsmodule.c
parentfbe7c559054e33a74a330462aa8ae0682910a414 (diff)
downloadcpython-2724ab99c8c81cdb032372871d8f1eebb171ebe7.zip
cpython-2724ab99c8c81cdb032372871d8f1eebb171ebe7.tar.gz
cpython-2724ab99c8c81cdb032372871d8f1eebb171ebe7.tar.bz2
Added zip, map, filter to future_bultins (#2171)
Diffstat (limited to 'Modules/itertoolsmodule.c')
-rw-r--r--Modules/itertoolsmodule.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 8c3375a..a369dc9 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -2542,7 +2542,7 @@ ifilter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
ifilterobject *lz;
if (Py_Py3kWarningFlag &&
- PyErr_Warn(PyExc_DeprecationWarning,
+ PyErr_Warn(PyExc_DeprecationWarning,
"In 3.x, itertools.ifilter() was moved to builtin filter().") < 0)
return NULL;
@@ -2552,6 +2552,15 @@ ifilter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (!PyArg_UnpackTuple(args, "ifilter", 2, 2, &func, &seq))
return NULL;
+ if (func == Py_None) {
+ if (Py_Py3kWarningFlag &&
+ PyErr_Warn(PyExc_DeprecationWarning,
+ "ifilter with None as a first argument "
+ "is not supported in 3.x. Use a list "
+ "comprehension instead.") < 0)
+ return NULL;
+ }
+
/* Get iterator. */
it = PyObject_GetIter(seq);
if (it == NULL)
@@ -3602,7 +3611,7 @@ inititertools(void)
&izip_type,
&iziplongest_type,
&permutations_type,
- &product_type,
+ &product_type,
&repeat_type,
&groupby_type,
NULL