#18159: cardinality must output Infinty or a Sage integer
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  enhancement        |       Status:  new
       Priority:  critical           |    Milestone:  sage-6.6
      Component:  categories         |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/18159                 |  17924b8da8777805ca17289e00e62c3beca5a146
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:8 ncohen]:
 > That they behave differently is not (to me) a sufficient reason to
 prevent everybody from returning python ints. Checking that the output can
 be turned into an int would be sufficient to detect this problem with
 rational numbers.

 All right, output string is accepted as well?

 This is very bad. Imagine I need something like:
 {{{
 sage: vector([s.cardinality() for s in S])
 }}}
 If any of the `s.cardinality()` returns a rational, I end up with a vector
 over rational numbers (which are much slower than over integers).

 It is very similar to `is_X` functions that return boolean answers. You
 might complain if they start returning `gap` booleans or `numpy` boolean
 objects.

 Vincent

--
Ticket URL: <http://trac.sagemath.org/ticket/18159#comment:9>
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