Ross Ridge <[EMAIL PROTECTED]> writes:
> D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote:
> >def calc_tax(*arg, **name):
> >from calc_tax import calc_tax as _func_
> >calc_tax = _func_
> >return _func_(*arg, **name)
>
> This should do what you want:
>
> def calc_tax(*arg, **name):
>
D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote:
>def calc_tax(*arg, **name):
>from calc_tax import calc_tax as _func_
>calc_tax = _func_
>return _func_(*arg, **name)
This should do what you want:
def calc_tax(*arg, **name):
global calc_tax
from calc
D'Arcy J.M. Cain wrote:
I am trying to create a utility module that only loads functions when
they are first called rather than loading everything. I have a bunch
of files in my utility directory with individual methods and for each I
have lines like this in __init__.py:
def calc_tax(*arg, **na
"D'Arcy J.M. Cain" <[EMAIL PROTECTED]> writes:
> 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.
Why not do that, then? Your functions should be organised
On Jul 10, 9:45 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote:
> I am trying to create a utility module that only loads functions when
> they are first called rather than loading everything. I have a bunch
> of files in my utility directory with individual methods and for each I
> have lines li
On Thu, 10 Jul 2008 11:03:10 -0500
Larry Bates <[EMAIL PROTECTED]> 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 opt
D'Arcy J.M. Cain wrote:
I am trying to create a utility module that only loads functions when
they are first called rather than loading everything. I have a bunch
of files in my utility directory with individual methods and for each I
have lines like this in __init__.py:
def calc_tax(*arg, **na
I am trying to create a utility module that only loads functions when
they are first called rather than loading everything. I have a bunch
of files in my utility directory with individual methods and for each I
have lines like this in __init__.py:
def calc_tax(*arg, **name):
from calc_tax imp