[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ideal directory structure?



Il giorno sab, 30/01/2010 alle 16.14 +0100, Josselin Mouette ha scritto:
> Le samedi 30 janvier 2010 à 15:32 +0100, Pietro Battiston a écrit : 
> > Then, in my apps, I put
> > 
> > not_installed_dir = os.path.dirname(os.path.realpath(__file__))
> 
> Every time you use introspection features (like __file__) for something
> else than introspection, you have completely failed somewhere in the
> design process.
> 
> __file__ is a plague. If it wasn’t here, people would have, long ago,
> developed correct distribution systems for Python instead of using such
> an unreliable way of determining the filesystem layout.
> 

In my ignorance, what I've exposed is the only way I know to get things
working as I want, so I'll be happy to get in touch with better
designs... for me, so far, __file__ may very well have been a hack, but
certainly not a plague.

Pietro


Reply to: