On 13/06/2017 01:41, Nils Bruin wrote:
On Monday, June 12, 2017 at 10:44:57 AM UTC-7, Daniel Krenn wrote:
If not sorted, should the output data structure be a Python set instead
of a list?
Conceptually it's a set, but for efficiency reasons it shouldn't be a
Python set. The extraneous hashing and equality testing is a waste (and the
returned data types shouldn't be guaranteed to be hashable, e.g. p-adics.
In fact, floats aren't really hashable either, even if hashing them doesn't
return an error). So I'd say a list is still the appropriate data type to
implement this with.
+1
And hashing algebraic numbers can be a *huge* waste of time. Much bigger
than sorting. Just try
sage: a = sum(AA(i).sqrt() for i in range(15))
sage: hash(a - a - 1/123456789)
--
You received this message because you are subscribed to the Google Groups
"sage-devel" 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-devel.
For more options, visit https://groups.google.com/d/optout.