#19498: Random failure in Integers(15).fraction_field()
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  defect             |       Status:  positive_review
       Priority:  blocker            |    Milestone:  sage-6.10
      Component:  categories         |   Resolution:
       Keywords:  random_fail        |    Merged in:
        Authors:  Jeroen Demeyer     |    Reviewers:  Travis Scrimshaw
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jdemeyer/random_failure_in_integers_15__fraction_field__|  
bb091596d543140f5077e05698b2f18e4711bddd
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by tscrim):

 * status:  needs_review => positive_review
 * reviewer:   => Travis Scrimshaw


Comment:

 Your commit looks good to me and fixes the doctest at hand.

 However the actual issue has something very subtle going on. Something
 strange is happening here:
 {{{
 sage: x = 20
 sage: Integers(x).category()
 Join of Category of finite commutative rings and Category of subquotients
 of monoids and Category of quotients of semigroups and Category of finite
 enumerated sets
 sage: Integers(x, is_field=True).category()
 Join of Category of finite fields and Category of subquotients of monoids
 and Category of quotients of semigroups
 sage: gc.collect()
 186
 sage: gc.collect()
 0
 sage: Integers(x).category()
 Join of Category of finite commutative rings and Category of subquotients
 of monoids and Category of quotients of semigroups and Category of finite
 enumerated sets
 }}}
 However, then doing the commands in comment:2 nails any of these in
 memory. We also have this:
 {{{
 sage: Integers(int(20), is_field=True).category()
 Join of Category of finite fields and Category of subquotients of monoids
 and Category of quotients of semigroups
 sage: Integers(int(20)).category()
 Join of Category of finite fields and Category of subquotients of monoids
 and Category of quotients of semigroups
 sage: gc.collect()
 136
 sage: gc.collect()
 0
 sage: Integers(int(20)).category()
 Join of Category of finite commutative rings and Category of subquotients
 of monoids and Category of quotients of semigroups and Category of finite
 enumerated sets
 }}}
 Even more strangeness as this works:
 {{{
 sage: Integers(Integer(20)).category()
 Join of Category of finite commutative rings and Category of subquotients
 of monoids and Category of quotients of semigroups and Category of finite
 enumerated sets
 sage: Integers(Integer(20), is_field=True).category()
 Join of Category of finite fields and Category of subquotients of monoids
 and Category of quotients of semigroups
 sage: gc.collect()
 251
 sage: gc.collect()
 0
 sage: Integers(Integers(20)).category()
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 ...
 TypeError: unable to coerce <class
 
'sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic_with_category'>
 to an integer
 sage: Integers(Integer(20)).category()
 Join of Category of finite commutative rings and Category of subquotients
 of monoids and Category of quotients of semigroups and Category of finite
 enumerated sets
 }}}
 versus this which doesn't:
 {{{
 sage: Integers(Integer(20), is_field=True).category()
 Join of Category of finite fields and Category of subquotients of monoids
 and Category of quotients of semigroups
 sage: gc.collect()
 64
 sage: gc.collect()
 0
 sage: Integers(Integer(20)).category()
 Join of Category of finite fields and Category of subquotients of monoids
 and Category of quotients of semigroups
 sage: Integers(Integers(20)).category()
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 ...
 TypeError: unable to coerce <class
 
'sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic_with_category'>
 to an integer
 sage: Integers(Integer(20)).category()
 Join of Category of finite fields and Category of subquotients of monoids
 and Category of quotients of semigroups
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/19498#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to