imports

0 views
Skip to first unread message

smichr

unread,
Oct 31, 2009, 11:41:54 PM10/31/09
to sympy
Does anyone know the reason for not including certain objects in a
module's __init__? e.g. "cartes" is not loaded in utilities/
__init__.py so although "sympy.utilities.iterables.cartes" works, a
"from sympy.utilities import *" does not import "cartes".

If the "from foo import *" is frowned upon, then what is the purpose
of declaring things in __init__? Does it just make it easier to get at
things, e.g.

>>> from sympy.utilities import any # rather than
>>> from sympy.utilities.iterables import any

This is perhaps a "tutur" sort of question, but it applies directly to
sympy and I thought I'd ask here first.

/c

Ondrej Certik

unread,
Nov 3, 2009, 2:26:12 PM11/3/09
to sy...@googlegroups.com

That's a good question. I just use a common sense and import things
that could be useful to most people directly into the sympy namespace,
and I leave the rest in the respective modules.

Maybe there are some better ways to handle this, I am interested in
other opinions.

Ondrej

Reply all
Reply to author
Forward
0 new messages