Trivial performance questions

Brian Patterson bp at computastore.com
Fri Oct 17 10:39:01 EDT 2003


>> I appreciate that these are trivial in the extreme, but I seem to be
>> writing dozens of them, and I may as well use the right one and
>> squeeze what performance I can.

> This is an unhelpful attitude.  You're writing in Python after all!

I have never considered using the fastest available option to be an
unhelpful attitude, especially when it does not impact on readability.  It
occurred to me that someone more knowledgable might know whether there was a
'right' answer to these trivial questions.

However, it appears not.  Sorry for wasting your time :(

Thanks for the tip on the getattr default.  This is much cleaner to read,
almost certainly quicker, and will serve the purpose well.  I had convinced
myself that it was not available in 2.1.3.







More information about the Python-list mailing list