summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorNeil Schemenauer <nascheme@enme.ucalgary.ca>2003-08-14 20:37:34 (GMT)
committerNeil Schemenauer <nascheme@enme.ucalgary.ca>2003-08-14 20:37:34 (GMT)
commit689735562d45a2c384fbe48069098a4459111fea (patch)
treee7764a07dbdb781fb8fd163225d634ff60b03094 /Python
parente5402fb340c5eea54858def3c5c294552a5f9faa (diff)
downloadcpython-689735562d45a2c384fbe48069098a4459111fea.zip
cpython-689735562d45a2c384fbe48069098a4459111fea.tar.gz
cpython-689735562d45a2c384fbe48069098a4459111fea.tar.bz2
Make filter(bool, ...) as fast as filter(None, ...).
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index fb92478..9f41efc 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -197,7 +197,7 @@ builtin_filter(PyObject *self, PyObject *args)
break;
}
- if (func == Py_None) {
+ if (func == (PyObject *)&PyBool_Type || func == Py_None) {
ok = PyObject_IsTrue(item);
}
else {