redundant imports

2005-03-30 Thread max(01)*
hi everybody. suppose that code-1.py imports code-2.py and code-3.py (because it uses names from both), and that code-2.py imports code-3.py. if python were c, code-1.c should only *include* code-2.c, because the latter in turns includes code-3.c. inclusion of modules in c is a purely preproces

Re: redundant imports

2005-03-30 Thread Tim Jarman
max(01)* wrote: > hi everybody. > > suppose that code-1.py imports code-2.py and code-3.py (because it uses > names from both), and that code-2.py imports code-3.py. > > if python were c, code-1.c should only *include* code-2.c, because the > latter in turns includes code-3.c. > > inclusion of

Re: redundant imports

2005-03-30 Thread Peter Hansen
er modules? That would pretty much defeat most of the value of namespaces. Anyway, why this concern over so-called redundant imports? The source code itself is not parsed and compiled all over again, and even the .pyc file is not re-read... once any module has imported a module any other import

Re: redundant imports

2005-03-31 Thread max(01)*
Tim Jarman wrote: max(01)* wrote: hi everybody. suppose that code-1.py imports code-2.py and code-3.py (because it uses names from both), and that code-2.py imports code-3.py. if python were c, code-1.c should only *include* code-2.c, because the latter in turns includes code-3.c. inclusion of mod

Re: redundant imports

2005-03-31 Thread max(01)*
amespaces. Anyway, why this concern over so-called redundant imports? The source code itself is not parsed and compiled all over again, and even the .pyc file is not re-read... once any module has imported a module any other import just retrieves a reference to that module from the sys.modules dictionary

Re: redundant imports

2005-03-31 Thread Peter Hansen
max(01)* wrote: this leads me to another question. since *.pyc files are automatically created the first time an import statement in executed on a given module, i guess that if i ship a program with modules for use in a directory where the user has no write privileges then i must ship the *.pyc

Re: redundant imports

2005-03-31 Thread Steve Holden
Peter Hansen wrote: max(01)* wrote: this leads me to another question. since *.pyc files are automatically created the first time an import statement in executed on a given module, i guess that if i ship a program with modules for use in a directory where the user has no write privileges then i

Re: redundant imports

2005-04-01 Thread max(01)*
Peter Hansen wrote: max(01)* wrote: this leads me to another question. since *.pyc files are automatically created the first time an import statement in executed on a given module, i guess that if i ship a program with modules for use in a directory where the user has no write privileges then i

Re: redundant imports

2005-04-02 Thread Mike Meyer
"max(01)*" <[EMAIL PROTECTED]> writes: > Peter Hansen wrote: >> max(01)* wrote: >> >>> hi everybody. >>> >>> suppose that code-1.py imports code-2.py and code-3.py (because it >>> uses names from both), and that code-2.py imports code-3.py. >>> >>> if python were c, code-1.c should only *include*

Re: redundant imports

2005-04-02 Thread Bengt Richter
On Sat, 02 Apr 2005 16:44:29 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote: >"max(01)*" <[EMAIL PROTECTED]> writes: > >> Peter Hansen wrote: >>> max(01)* wrote: >>> hi everybody. suppose that code-1.py imports code-2.py and code-3.py (because it uses names from both), and that co

Re: redundant imports

2005-04-03 Thread Serge Orlov
Mike Meyer wrote: > The semantic behavior of "include" in C is the same as "from module > import *" in python. Both cases add all the names in the included > namespace directly to the including namespace. This usage is > depreciated in Python ... Did you mean discouraged? Or it's really slated f

Re: redundant imports

2005-04-04 Thread Peter Hansen
Serge Orlov wrote: Mike Meyer wrote: The semantic behavior of "include" in C is the same as "from module import *" in python. Both cases add all the names in the included namespace directly to the including namespace. This usage is depreciated in Python ... Did you mean discouraged? Or it's real

Re: redundant imports

2005-04-05 Thread max(01)*
Mike Meyer wrote: "max(01)*" <[EMAIL PROTECTED]> writes: Peter Hansen wrote: max(01)* wrote: hi everybody. suppose that code-1.py imports code-2.py and code-3.py (because it uses names from both), and that code-2.py imports code-3.py. if python were c, code-1.c should only *include* code-2.c, bec