From: Andre W. <wo...@us...> - 2003-10-16 13:23:28
|
Hi, On 16.10.03, Michael Schindler wrote: > > On 16.10.03, Joerg Lehmann wrote: > > > I'm not sure about that. Of course, at the moment an "import pyx" > > > doesn't do anything (expect providing access to pyx.__version__ and > > > pyx.__all__) and using the code given above it would at least do > > > something reasonable. On the other hand, the behaviour seems to > > > be rather implicit than explicit to me. So, as I said, I don't know. > > > > Well, same for me. Should we play dice now? > > I threw a coin, and it said "Number" -- what now? That's bad actually. We should find a coin telling "import all into pyx namespace" or "leave it the way it is" ... > 2. There might be some conflicts with other module names, and in this > case it is more work to import the necessary modules one by one > without these conflicts. Well, thats why the idea is to allow for: import pyx pyx.text.set(...) Note the missing "import pyx.text" statement. Importing something into the pyx namespace should not make any difficulties in terms of name clashs. > 3. Loading everything by default is not a good idea, as can be seen in the > scipy-project which is too slow for usage. It might be also (indeed almost at least for PyX; I'm not familiar with scipy) a question of creating a lot instances during loading. We do have this problem with the attributes right now but an proposel with a different approach is aborning. In terms of loading time this should be the most crucial aspect. > Is there a possibility for the following? > "import pyx" --> access via "pyx.canvas.canvas()", everything > is loaded automatically > "from pyx import *" --> say "canvas.canvas()" instead Wasn't exactly this behaviour suggested? But then point 3 applies always while it doesn't right now. (The automatic loading into the pyx namespace is done at the import statement.) André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us... / _ \ \/\/ / PyX - High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ |