is there any principle when writing python function

Ulrich Eckhardt ulrich.eckhardt at dominolaser.com
Tue Aug 23 09:00:47 EDT 2011


smith jack wrote:
> i have heard that function invocation in python is expensive, but make
> lots of functions are a good design habit in many other languages, so
> is there any principle when writing python function?
> for example, how many lines should form a function?

Don't compromise the design and clarity of your code just because you heard 
some rumors about performance. Also, for any performance question, please 
consult a profiler.

Uli

-- 
Domino Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932




More information about the Python-list mailing list