#18290: enhanced sets and cartesian products
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  vdelecroix             |       Status:  needs_review
           Type:         |    Milestone:  sage-6.7
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:         |    Reviewers:
  categories             |  Work issues:
       Keywords:         |       Commit:
  cartesian_product      |  6389ff27cbcfcc1d51f2b6ad346c79ccd7eebbe3
        Authors:         |     Stopgaps:
  Vincent Delecroix      |
Report Upstream:  N/A    |
         Branch:         |
  public/18290           |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by vdelecroix):

 Replying to [comment:34 ncohen]:
 > > As a rationale: a less specialized method should not try to call a
 more specialized one.
 >
 > Are the 'new rationales' just made up when we need them, or should we
 stop having `.cardinality()` call `__iter__`, as it is exactly the same
 pattern?

 ;-) I agree with Nathann that it is perhaps not the best default. Though,
 let us keep it independent of this ticket. My motivation for the rationale
 was to avoid loops like

 - is_finite asks cardinality
 - cardinality asks is_finite before starting to iterate

 (which is exactly the problem with projective scheme).

 On the other hand, there is sometimes nothing else to do than going
 through the list of elements to get the cardinality. And you know it:
 `sage.graphs.independent_sets.IndependentSets`.

 Vincent

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