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

Commit

Permalink
py3: fix doctests in power series
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric Chapoton committed Oct 23, 2018
1 parent a0a5f59 commit 7712a7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
15 changes: 7 additions & 8 deletions src/sage/rings/multi_power_series_ring_element.py
Expand Up @@ -148,13 +148,12 @@
- Simon King (08/2012): Use category and coercion framework, :trac:`13412`
"""

#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2010 Niles Johnson <nilesj@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*****************************************************************************
# https://www.gnu.org/licenses/
# ****************************************************************************
from six import iteritems, integer_types

from sage.structure.richcmp import richcmp
Expand Down Expand Up @@ -1183,11 +1182,11 @@ def monomials(self):
sage: R.<a,b,c> = PowerSeriesRing(ZZ); R
Multivariate Power Series Ring in a, b, c over Integer Ring
sage: f = 1 + a + b - a*b - b*c - a*c + R.O(4)
sage: f.monomials()
[1, b*c, b, a, a*c, a*b]
sage: sorted(f.monomials())
[b*c, a*c, a*b, b, a, 1]
sage: f = 1 + 2*a + 7*b - 2*a*b - 4*b*c - 13*a*c + R.O(4)
sage: f.monomials()
[1, b*c, b, a, a*c, a*b]
sage: sorted(f.monomials())
[b*c, a*c, a*b, b, a, 1]
sage: f = R.zero()
sage: f.monomials()
[]
Expand Down
12 changes: 5 additions & 7 deletions src/sage/rings/power_series_poly.pyx
Expand Up @@ -77,17 +77,15 @@ cdef class PowerSeries_poly(PowerSeries):

def __hash__(self):
"""
Return a hash of self.
Return a hash of ``self``.
EXAMPLES::
sage: R.<t> = ZZ[[]]
sage: t.__hash__()
760233507 # 32-bit
14848694839950883 # 64-bit
sage: hash(t)
760233507 # 32-bit
14848694839950883 # 64-bit
sage: hash(t) == hash(R.gen())
True
sage: hash(t) != hash(R.one())
True
"""
return hash(self.__f)

Expand Down

0 comments on commit 7712a7e

Please sign in to comment.