all() is slow?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Nov 10 02:35:48 EST 2011


On Wed, 09 Nov 2011 19:50:42 -0800, alex23 wrote:

>> I pointed this out in a thread full of people saying "never EVER use
>> exec this way", so it's obviously not just me that thinks this is
>> awful.
> 
> No, instead you have a thread full of people happy to criticise
> something for which they're providing no alternative implementation. You
> can't exactly say _why_ it's bad, other than other people have echoed
> it, but you won't actually do anything about it.

In fairness there are alternative implementations. They are not identical 
to the version using exec. There is at least one use-case for *not* using 
exec, even at the cost of functionality: a restricted Python environment 
without exec.

On the other hand, a restricted Python without exec is not actually 
Python.



-- 
Steven



More information about the Python-list mailing list