Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac 19016: add hash value for asymptotic ring elt
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Oct 27, 2015
1 parent 04c79ad commit 81012bc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/sage/rings/asymptotic/asymptotic_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,26 @@ def summands(self):
return self._summands_


def __hash__(self):
r"""
A hash value for this element.
.. WARNING::
This hash value uses the string representation and might not be
always right.
TESTS::
sage: R_log = AsymptoticRing(growth_group='log(x)^QQ', coefficient_ring=QQ)
sage: lx = R_log(log(SR.var('x')))
sage: elt = (O(lx) + lx^3)^4
sage: hash(elt) # random
-4395085054568712393
"""
return hash(str(self))


def __nonzero__(self):
r"""
Return whether this asymptotic expansion is not identically zero.
Expand Down

0 comments on commit 81012bc

Please sign in to comment.