[mod_python] problem with file download in mod-python 3.0.1

Michal Vitecek fuf at mobil.cz
Fri Dec 13 09:10:35 EST 2002

Manera, Villiam wrote:


>     def sim_methods(self,obj):
>         from types import BuiltinMethodType   
>         return filter(lambda s, t=obj:
>            type(getattr(t, s)) == BuiltinMethodType, dir(obj))

 I just wanted to say that code using lambda functions is considerably
 slower than when it uses list comprehensions. thus the above is faster
    def sim_methods(self, obj):
	from types import BuiltinMethodType
	return [attribute for attribute in dir(obj) if (type(getattr(obj,
		attribute)) == BuiltinMethodType)]

		fuf		(fuf at mobil.cz)

More information about the Mod_python mailing list