#19029: doctest Python vs Sage ints
-------------------------------------+-------------------------------------
       Reporter:  vbraun             |        Owner:
           Type:  enhancement        |       Status:  new
       Priority:  major              |    Milestone:  sage-6.9
      Component:  user interface     |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Volker Braun       |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vbraun/doctest_python_vs_sage_ints|  
129259d7e537f92b1e55fbb414477231117456fc
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by jmantysalo):

 Replying to [comment:22 dkrenn]:
 > Replying to [comment:21 jmantysalo]:
 > > Should this be closed as wontfix? The basic problem seems to be that
 we have no common view of what to do.
 >
 > As mentioned above, I would be very happy to be able to turn it on on
 request, so that I can check my new code gives the types I intended. Since
 a doctesting-option seemed to be refused; any other ideas how this could
 be achieved?

 Hmm... Is it possible to have some kind of debug mode, so that every
 output would be started with type? But I can see no easy way to do it. A
 decorator over `__repr__` somehow?

 Of course for a one function you could have a test block

 {{{
 g1 = Graph({})  # Empty
 g2 = Graph({1:[2]})  # Not empty
 type(g1.order()) == type(g2.order())
 }}}

 and so on. But the basic question remains: is it an error to have, for
 example, poset `width()` and `height()` return a different type? Should
 every `cardinality()`-like function return Sage Integers, and if so, what
 to do with `len` etc.?

--
Ticket URL: <http://trac.sagemath.org/ticket/19029#comment:23>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to