#20028: sorting of number field elements
-------------------------------------+-------------------------------------
       Reporter:  cremona            |        Owner:
           Type:  defect             |       Status:  new
       Priority:  major              |    Milestone:  sage-7.1
      Component:  number fields      |   Resolution:
       Keywords:  sort number field  |    Merged in:
  elements                           |    Reviewers:
        Authors:                     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:  u/cremona/20028    |  f9f6b99b09fc6c5183d2fe7a82e4f27e957f059c
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nbruin):

 Replying to [comment:19 cremona]:
 > It is odd to me that sorted(X) has the side effect of changing a set to
 a list

 The wonders of python's ducktyping: "sorted" accepts an iterable and
 returns the contents of the iterable as a sorted list. A finite set is an
 iterable.

 > but now that we know that we just make it into a list regardless of
 whether we are able to sort it.

 Uhm. I don't have a problem returning things in a list in no particular
 order, but actively turning something that comes naturally in a set into a
 list just for the sake of it sounds wrong. If the routine you're getting
 your data from returns a set, perhaps you should too? or perhaps that
 routine benefits from returning a list instead? This doesn't necessarily
 need to be resolved here, but bear in mind that postponing a cleaner
 resolution is the process through which cruft builds up in sage.

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