> I just realized that filter(bool, ...) is the same as filter(None, ...). > Anyone object to optimizing the 'bool' case? I think using 'bool' is > much clearer than 'None'. > > Neil > > Index: Python/bltinmodule.c > =================================================================== > RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v > retrieving revision 2.293 > diff -u -r2.293 bltinmodule.c > --- Python/bltinmodule.c 2 Aug 2003 07:42:56 -0000 2.293 > +++ Python/bltinmodule.c 14 Aug 2003 17:49:26 -0000 > @@ -197,7 +197,7 @@ > break; > } > > - if (func == Py_None) { > + if (func == Py_None || func == (PyObject *)&PyBool_Type) { > ok = PyObject_IsTrue(item); > } > else { Cute. But I still think it's better to spell this as list(x) --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4