[Numpy-discussion] object dtype questions

Sturla Molden sturla@molden...
Sun Sep 6 16:12:31 CDT 2009

Alan G Isaac skrev:
> http://article.gmane.org/gmane.comp.python.general/630847

Yes, but here you still have to look up the name 'f' from locals in each 
iteration. map is written in C, once it has as PyObject* to the callable 
it does not need to look up the name anymore. The dictionary lookup(s) 
to get the callable is done just once. map is also more thread-safe. 
During the iteration another thread could rebind the name of the 
callable, but map is impervious to that.


More information about the NumPy-Discussion mailing list