[SciPy-User] Making Python Lazy

Gael Varoquaux gael.varoquaux@normalesup....
Thu Sep 9 06:30:59 CDT 2010

Not excatly what you want, but joblib, http://packages.python.org/joblib/
addresses partly this issue.

I won't say more on the list , os this is code that is still work in
progress, and I was meaning to announce it to the scipy community only in
a little while. However, we do use it in production on big datasets (0.5
branch on github has issues, use latest release or 0.4.X branch...).


On Thu, Sep 09, 2010 at 12:25:37PM +0200, Lorenzo Isella wrote:
> Dear All,
> I hope this is not too off-topic.
> I am wondering if there is any possibility to make a Python code lazy 
> i.e. to prevent it from calculating quantities which are not used in the 
> code.
> As an example: you are in a rush to modify your code and at the end it 
> ends up with "dead branches", let's say an array which is calculated but 
> not used in any following calculations, not printed on screen, not 
> stored in a file etc...
> It would be nice to teach Python to automagically skip its calculation 
> when I run the script (at least in a non-interactive way).
> I know that such a situation is probably the result of bad programming 
> habits, but it may arise all the same.
> If I understand correctly, what I am asking for is something different 
> from garbage collection, which would take place, if ever, only after the 
> array has been calculated.
> Any suggestions (or clarifications if I am on the wrong track) are 
> appreciated.
> Cheers

> Lorenzo
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user

    Gael Varoquaux
    Research Fellow, INRIA
    Laboratoire de Neuro-Imagerie Assistee par Ordinateur
    NeuroSpin/CEA Saclay , Bat 145, 91191 Gif-sur-Yvette France
    Phone:  ++ 33-1-69-08-78-35
    Mobile: ++ 33-6-28-25-64-62

More information about the SciPy-User mailing list