Loading just in time

D'Arcy J.M. Cain darcy at druid.net
Thu Jul 10 12:13:45 EDT 2008


On Thu, 10 Jul 2008 11:03:10 -0500
Larry Bates <larry.bates at websafe.com`> wrote:
> D'Arcy J.M. Cain wrote:
> > def calc_tax(*arg, **name):
> >     from calc_tax import calc_tax as _func_
> >     calc_tax = _func_
> >     return _func_(*arg, **name)

> You are stuck in a futile battle called "premature optimization".  I would 

I thought that I might be.

> suggest that you stop worrying about any performance you would gain from doing 
> something like this.  Python has been "highly" optimized to handle imports in a 
> very efficient way.  Just put your functions in a file and import them.

Performance optimization wasn't really my goal here.  What I was
looking for was the ability to spread the functions around different
files to manage them better from a proggrammer's POV.

Oh well.  I guess I will just combine them all again.  At least I found
some dead code, duplicate functions and just plain bad code doing this
little exercise.  :-)

-- 
D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



More information about the Python-list mailing list