implicit imports

2 views
Skip to first unread message

Ondrej Certik

unread,
Jul 21, 2008, 8:37:09 AM7/21/08
to sage-...@googlegroups.com
Hi,

what is your view on using implicit imports? Should they be allowed?
Or decided an a case by case basis? A quick search has revealed there
are 44 places in Sage where
implicit import is used:

ondra@fuji:~/ext/sage/devel/sage$ grep -H -r '^\s*from.*import.*\*'
--include='*.py' --exclude="all.py" sage/ | wc -l
44
ondra@fuji:~/ext/sage/devel/sage$ grep -H -r '^\s*from.*import.*\*'
--include='*.py' --exclude="all.py" sage/
sage/matrix/benchmark.py:from sage.all import *
sage/modular/modform/test.py:from sage.all import *
sage/misc/benchmark.py:from sage.all import *
sage/all_cmdline.py: from sage.all import *
sage/libs/pari/bg.py:from sage.libs._pari.functional import *
sage/libs/pari/gen_py.py:from sage.rings.all import *
sage/all_notebook.py:from sage.all import *
sage/groups/abelian_gps/dual_abelian_group_element.py:from
sage.rings.arith import *
sage/groups/abelian_gps/abelian_group_morphism.py:from
sage.groups.perm_gps.permgroup import *
sage/groups/abelian_gps/abelian_group_morphism.py:from
sage.interfaces.gap import *
sage/groups/abelian_gps/abelian_group_morphism.py:from
sage.categories.morphism import *
sage/groups/abelian_gps/abelian_group_morphism.py:from
sage.categories.homset import *
sage/groups/matrix_gps/matrix_group_morphism.py:from
sage.categories.morphism import *
sage/groups/perm_gps/permgroup_morphism.py:from
sage.categories.morphism import *
sage/groups/perm_gps/cubegroup.py:from sage.plot.plot3d.shapes import *
sage/dsage/scripts/dsage_worker.py:from gnutls.constants import *
sage/dsage/scripts/dsage_worker.py:from gnutls.crypto import *
sage/dsage/scripts/dsage_worker.py:from gnutls.errors import *
sage/dsage/misc/constants.py:from gnutls.constants import *
sage/dsage/misc/constants.py:from gnutls.crypto import *
sage/dsage/misc/constants.py:from gnutls.errors import *
sage/dsage/dist_functions/dist_factor.py:from sage.all import *
sage/dsage/database/db_config.py:from sqlalchemy import *
sage/dsage/database/jobdb.py:from sqlalchemy import *
sage/dsage/database/schema.py:from sqlalchemy import *
sage/interfaces/frobby.py:from subprocess import *
sage/interfaces/rubik.py:from sage.groups.perm_gps.cubegroup import *
sage/interfaces/magma_sim.py:from sage.all import *
sage/interfaces/gfan.py:from subprocess import *
sage/interfaces/phc.py:from sage.plot.plot import *
sage/interfaces/tests.py:from all import *
sage/tests/benchmark.py:from sage.all import *
sage/combinat/posets/posets.py:from sage.combinat.posets.elements import *
sage/rings/arith_gmp.py:from sage.ext.arith_gmp import *
sage/rings/arith_c.py:from sage.ext.arith import *
sage/rings/padics/factory.py:from padic_extension_leaves import *
sage/categories/category_types.py:from category import *
sage/categories/pushout.py:from category_types import *
sage/coding/guava.py:from sage.misc.preparser import *
sage/coding/guava.py:from sage.groups.perm_gps.permgroup import *
sage/coding/guava.py:from linear_code import *
sage/functions/special.py:from functions import *
sage/functions/orthogonal_polys.py:from functions import *
sage/geometry/polytope.py:from subprocess import *


Is it a leftover or on purpose, or it doesn't matter?

Ondrej

William Stein

unread,
Jul 21, 2008, 8:43:57 AM7/21/08
to sage-...@googlegroups.com
On Mon, Jul 21, 2008 at 2:37 PM, Ondrej Certik <ond...@certik.cz> wrote:
>
> Hi,
>
> what is your view on using implicit imports?

I do not like them.

> Should they be allowed?

Yes. Sometimes they are the right thing for a job, e.g., in the all.py's
and a few other places.

> Or decided an a case by case basis? A quick search has revealed there
> are 44 places in Sage where
> implicit import is used:

I am very unhappy about many of the implicit imports below (well, except for
all the ones I wrote which I'm happier with... :-)).

--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

Reply all
Reply to author
Forward
0 new messages