Neal> I noticed in some profiling, that it seems that:

    Neal> def Func ():
    Neal>   def something():
    Neal>     ...

    Neal> It appears that if Func is called many times, this nested func
    Neal> definition will cause significant overhead.  Is this true?  I
    Neal> guess I've become accustomed to decent compilers performing
    Neal> reasonable transformations and so have tended to write code for
    Neal> clarity.

It could.  OTOH, the code object which implements the something body is
stored as a local var (or a constant, can't remember off the top of my
head), so it's not compiled over and over again.

-- 
Skip Montanaro - [EMAIL PROTECTED] - http://smontanaro.dyndns.org/
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to