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

Commit

Permalink
py3: fixes for doctests of cpython
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric Chapoton authored and jdemeyer committed Dec 10, 2018
1 parent d45ef02 commit 8dde842
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/sage/cpython/dict_del_by_value.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ AUTHORS:
#
# Distributed under the terms of the GNU General Public License (GPL)
#
# http://www.gnu.org/licenses/
# https://www.gnu.org/licenses/
########################################################################
from __future__ import print_function, absolute_import

Expand Down Expand Up @@ -438,6 +438,5 @@ def test_del_dictitem_by_exact_value(D, value, h):
sage: test_del_dictitem_by_exact_value(D, QQ, 1)
sage: D
{1: Integer Ring}
"""
return del_dictitem_by_exact_value(<PyDictObject *>D, <PyObject *>value, h)
8 changes: 4 additions & 4 deletions src/sage/cpython/getattr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ cpdef raw_getattr(obj, name):
sage: raw_getattr(X, "prop")
<property object at ...>
sage: raw_getattr(X, "method")
<function method at ...>
<function ...method at ...>
sage: raw_getattr(X, "attr")
Traceback (most recent call last):
...
Expand All @@ -170,7 +170,7 @@ cpdef raw_getattr(obj, name):
sage: raw_getattr(x, "prop")
<property object at ...>
sage: raw_getattr(x, "method")
<function method at ...>
<function ...method at ...>
sage: raw_getattr(x, "attr")
'magic attr'
sage: x.__dict__["prop"] = 'no'
Expand All @@ -190,7 +190,7 @@ cpdef raw_getattr(obj, name):
sage: raw_getattr(Y, "prop")
<property object at ...>
sage: raw_getattr(Y, "method")
<function method at ...>
<function ...method at ...>
sage: raw_getattr(Y, "attr")
Traceback (most recent call last):
...
Expand All @@ -199,7 +199,7 @@ cpdef raw_getattr(obj, name):
sage: raw_getattr(y, "prop")
<property object at ...>
sage: raw_getattr(y, "method")
<function method at ...>
<function ...method at ...>
sage: raw_getattr(y, "attr")
'magic attr'
sage: y.__dict__["prop"] = 'no'
Expand Down
6 changes: 4 additions & 2 deletions src/sage/cpython/wrapperdescr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ Pure Python classes have normal methods, not slot wrappers::
sage: class X(object):
....: def __add__(self, other):
....: return NotImplemented
sage: X.__add__
sage: X.__add__ # py2
<unbound method X.__add__>
sage: X.__add__ # py3
<function X.__add__ at ...>
"""

#*****************************************************************************
Expand All @@ -27,7 +29,7 @@ Pure Python classes have normal methods, not slot wrappers::
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
# https://www.gnu.org/licenses/
#*****************************************************************************

from .string import bytes_to_str
Expand Down

0 comments on commit 8dde842

Please sign in to comment.