python code optimization

2005-12-30 Thread Darius Kučinskas
Hi,I know that sometimes optimization is not good idea.So I want to know what you think about this one:we have code like this: tables = []for i in ... : tables.extend(...)we optimize code like this:tables = []pfTablesExtend = tables.extendfor i in ... : pfTablesExtend(...)I what to know is this

Re: python code optimization

2005-12-30 Thread Peter Hansen
Darius Kučinskas wrote: I know that sometimes optimization is not good idea. It's neither good nor bad. Whether or not to optimize is merely a decision that should not be made without considering the cost, and without a real need driving it. The need can only be seen by profiling your code