Could someone highlight why the following happens?

from a sage session, the names that can be imported from
sage.rings.integer_ring are:

{{{
EuclideanDomains     Z                    factor
is_IntegerRing
IntegerRing          ZZ                   factorization        ring
IntegerRing_class    arith                gmp_randrange        sage
ParentWithGens       clear_mpz_globals    init_mpz_globals
Sequence             crt_basis            integer_ring_python
}}}

However, from a sage -ipython session we have the following:

{{{
IntegerRing        clear_mpz_globals  factor
init_mpz_globals
IntegerRing_class  crt_basis          gmp_randrange
is_IntegerRing
}}}

Imported names and variables defined without def are not available in
ipython?

I suspect that this has to do with cython and extension modules and
has a bad impact on lazy_import since not all names can be
lazy_imported. Moreover, on a pure ipython session it is trivial to
get segfaults unless one import all from sage.all

{{{
$ sage -ipython
In [1]: from sage.rings.integer_ring import *
...
AttributeError: 'module' object has no attribute 'ZZ'
In [2]: from sage.rings.integer_ring import *

In [3]: IntegerRing()


------------------------------------------------------------
Unhandled SIGSEGV: A segmentation fault occurred in Sage.
This probably occurred because a *compiled* component
of Sage has a bug in it (typically accessing invalid memory)
and is not properly wrapped with sig_on(), sig_off().
You might want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate (sorry).
------------------------------------------------------------
}}}


-- 
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