Andre Engels wrote:
On Thu, Mar 11, 2010 at 2:30 PM, Steve Holden <st...@holdenweb.com> wrote:

The example I showed was just a toy problem.  The real problem is
I expect to call a function many times, and I want to avoid the overhead of
the 'if blah' everytime.

This is a premature optimization. First, make it work. Then (if it
doesn't work fast enough) make it work faster.

Corrolary: When you do make it faster, make it faster where it is slow.
Second corrolary: If making it fast is so important that these two
rules do not apply, Python is not your language of choice.

Addendum: a bad algorithm is bad, whatever language it's written in.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to