On Thu, Mar 3, 2011 at 2:12 PM, luisfe <lftab...@yahoo.es> wrote:
> The difference is with sage.all
>
> $ sage -ipython
> Python 2.6.4 (r264:75706, Jan 15 2011, 11:46:28)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.9.1 -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints
> more.
>
> In [1]: import sage.all
>
> In [2]: dir(sage.rings.integer)
> Out[2]: ['CoercionException', 'GCD_list', 'Integer', 'IntegerWrapper',
> 'LCM_list', 'MAX_UNSIGNED_LONG', 'ONE', '__builtins__', '__doc__',
> '__file__', '__name__', '__package__', '_test_mpz_set_longlong',
> 'arith', 'bin_op', 'canonical_coercion', 'clear_mpz_globals', 'doc',
> 'free_integer_pool', 'gmp_randrange', 'init_mpz_globals',
> 'initialized', 'int_to_Z', 'integer_ring', 'is_Integer', 'long_to_Z',
> 'make_integer', 'mpz_t_offset_python', 'operator', 'parent', 'sage',
> 'sys', 'the_integer_ring']
>
>
>
>
> Without importing sage.all
>
>
>
> $ sage -ipython
> Python 2.6.4 (r264:75706, Jan 15 2011, 11:46:28)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.9.1 -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints
> more.
>
> In [1]: from sage.rings.integer_ring import
> IntegerRing        clear_mpz_globals  factor
> init_mpz_globals
> IntegerRing_class  crt_basis          gmp_randrange
> is_IntegerRing
>
> In [1]: from sage.rings.integer_ring import ZZ
> ---------------------------------------------------------------------------
> ImportError                               Traceback (most recent call
> last)
>
> /home/rosamari/sage/<ipython console> in <module>()
>
> ImportError: cannot import name ZZ
>
>
>
> I need to do/import something before, I can import ZZ defined in
> sage.rings.integer_ring?

All bets are off when you import things in the wrong order--in
particular, circular imports may be getting in the way here. There's
probably some C-level initialization as well.

- Robert

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to