Mercurial > cpython-lru_cache-weakref
comparison Python/bltinmodule.c @ 45928:e665a0b16da0 legacy-trunk
The filter() function does support a None argument in Py3.0.
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Wed, 19 Mar 2008 17:58:59 +0000 |
| parents | 727f743cf630 |
| children | 84bb7701efba |
comparison
equal
deleted
inserted
replaced
| 45927:dc5be0b3c3be | 45928:e665a0b16da0 |
|---|---|
| 294 goto Fail_result_it; | 294 goto Fail_result_it; |
| 295 break; | 295 break; |
| 296 } | 296 } |
| 297 | 297 |
| 298 if (func == (PyObject *)&PyBool_Type || func == Py_None) { | 298 if (func == (PyObject *)&PyBool_Type || func == Py_None) { |
| 299 if (Py_Py3kWarningFlag && | |
| 300 PyErr_Warn(PyExc_DeprecationWarning, | |
| 301 "filter with None as a first argument " | |
| 302 "is not supported in 3.x. Use a list " | |
| 303 "comprehension instead.") < 0) | |
| 304 return NULL; | |
| 305 | |
| 306 ok = PyObject_IsTrue(item); | 299 ok = PyObject_IsTrue(item); |
| 307 } | 300 } |
| 308 else { | 301 else { |
| 309 PyObject *good; | 302 PyObject *good; |
| 310 PyTuple_SET_ITEM(arg, 0, item); | 303 PyTuple_SET_ITEM(arg, 0, item); |
