[Python-ideas] Add a "sitedirs" list in the site module

spir denis.spir at free.fr
Thu May 14 14:03:20 CEST 2009


Le Thu, 14 May 2009 12:10:41 +0200,
Tarek Ziadé <ziade.tarek at gmail.com> s'exprima ainsi:

> Right now there's no way to differenciate in sys.path the directories
> that where added through site.addsitedirs calls,
> (like when python starts up and initializes site-packages directories)
> 
> Anyone can change sys.path, and add elements in them.
> 
> So there's no way to answer to this simple question for sure : "what
> are the site-packages directories ?"

Do you mean in fact be able to know e.g. what PYTHONPATH contained before python startup?
If yes, I'm +1 for this. I would even differenciate
- sys.pythondir (where the executable is, if anyone cares)
- sys.defaultlibdir (where we should install a package)

Denis
------
la vita e estrany



More information about the Python-ideas mailing list