#18244: mysterious doctest failure on dyck_word.py
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  vdelecroix             |       Status:  needs_review
           Type:         |    Milestone:  sage-6.7
  defect                 |   Resolution:
       Priority:  major  |    Merged in:
      Component:         |    Reviewers:
  documentation          |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  5dfb8363c6fe1920dbaa09e3bae1e8f5a76be34c
Report Upstream:  N/A    |     Stopgaps:
         Branch:         |
  public/18244           |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by vdelecroix):

 Replying to [comment:11 SimonKing]:
 > Replying to [comment:8 behackl]:
 > > Some more information: the problem **definitely** is, that
 `cardinality` may return a Python integer. For testing purposes, I
 converted the output to a sage `Integer`, and as a result building and
 testing works.
 > >
 > > However, even if I delete the example at lines 3583-3585, the error
 remains. I haven't really figured out yet where the Python integers
 magically appear.
 >
 > I somehow disagree with that analysis that it is a **problem** that
 `cardinality` returns a Python integer. Yes, the category test suite
 verifies that `cardinality` returns a Sage integer. However (and that's
 why I Cc Nicolas) I don't think that the test should be so restrictive.

 I like this to be restrictive. See also #18159. I often write things like
 {{{
     return S1.cardinality().factorial()
 }}}
 which would break if it was a Python integer. Your suggestion implies that
 I need to do
 {{{
     from sage.rings.integer_ring import ZZ
     return ZZ(S1.cardinality()).factorial()
 }}}

 Moreover, in that particular case, I dislike the behavior of the example
 in [comment:4 comment:4]. Depending on the execution you got a Python int
 or a Sage integer! This is very bad.

 > Hence, would it not be a better solution to modify the test so that it
 accepts both sage and python integers (and infinity)?

 This has to be discussed (maybe on #18159). And which infinity?

 Vincent

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