redundant imports

From: max(01)* (max2_at_fisso.casa)
Date: 03/30/05


Date: Wed, 30 Mar 2005 12:47:30 GMT

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 preprocessing textual matter
(compilation is deferred to after the fact), i guess, so that such
things are possible. import of modules in python is a different beast,
so the "redundancy" is (i think) necessary.

any comment/suggestion/idea?

bye

macs



Relevant Pages

  • Re: redundant imports
    ... inclusion of modules in c is a purely preprocessing textual matter (compilation is deferred to after the fact), i guess, so that such things are possible. ... That doesn't change the fact that code-1 needs names from code-3, and just because code-3 is imported elsewhere is no reason to think that code-1 magically gets its names too. ...
    (comp.lang.python)
  • Re: redundant imports
    ... > inclusion of modules in c is a purely preprocessing textual matter ... into sys.modules and any subsequent imports refer to that original import, ... Python also caches compilation results in *.pyc ...
    (comp.lang.python)
  • Framework SP2
    ... We applied .Net framework to our dev server and now we get the compilation ... Microsoft Visual Basic .NET Compiler version 7.10.6310.4 ... Line 14: Imports Microsoft.VisualBasic ...
    (microsoft.public.dotnet.framework)
  • RE: Compile Problem: BC31011- Access is denied
    ... An error occurred during the compilation of a resource required ... > dll': Access is denied. ... > Line 14: Imports Microsoft.VisualBasic ... > Line 29: Namespace ASP ...
    (microsoft.public.dotnet.framework.aspnet)
  • Compile Problem: BC31011- Access is denied
    ... An error occurred during the compilation of a resource required ... dll': Access is denied. ... Copyright Microsoft Corporation 1987-2002. ... Line 14: Imports Microsoft.VisualBasic ...
    (microsoft.public.dotnet.framework.aspnet)