all() is slow?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Nov 9 18:11:51 EST 2011


On Wed, 09 Nov 2011 18:01:16 -0500, Devin Jeanpierre wrote:

>> If it were someone other than Raymond Hettinger responsible for the use
>> of exec in namedtuple, I'd be a lot more suspicious of it.
> 
> I'm not going to be less suspicious based on a name.

Neither am I. I am less suspicious based on a reputation. Raymond is a 
well-known, trusted senior Python developer who knows what he is doing.


> It reads like
> insanity, and the justification was terrible.

It reads fine, and the justification is perfectly valid.

You're right to be cautious of exec. You're wrong to be phobic about it. 
What do you think is going to happen? The exec call inside namedtuple is 
going to creep out of the module in the wee hours of the night, 
contaminating other functions and modules while you sleep? Be serious. If 
you have an actual concrete security vulnerability caused by the use of 
exec inside namedtuple, or some other bug, then say so. Otherwise, your 
paranoia is unjustified.



-- 
Steven



More information about the Python-list mailing list