summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen Demeyer <jdemeyer@cage.ugent.be>2017-04-03 14:31:36 +0200
committerJeroen Demeyer <jdemeyer@cage.ugent.be>2017-08-22 17:06:51 +0200
commit4062ec68cca650a62e107a109b9cea64cfcc2041 (patch)
treec22116c578fa0e1b93dea38779318bbc1c87cd51
parentCompile Cython code with binding=True (diff)
Sage library fixes for binding=Trueu/jdemeyer/ticket/22747
-rw-r--r--src/doc/en/developer/coding_in_cython.rst2
-rw-r--r--src/doc/en/prep/Programming.rst15
-rw-r--r--src/doc/en/prep/Symbolics-and-Basic-Plotting.rst2
-rw-r--r--src/doc/en/thematic_tutorials/coercion_and_categories.rst4
-rw-r--r--src/sage/__init__.py5
-rw-r--r--src/sage/arith/misc.py8
-rw-r--r--src/sage/categories/category.py4
-rw-r--r--src/sage/categories/modules.py1
-rw-r--r--src/sage/categories/primer.py6
-rw-r--r--src/sage/combinat/sf/classical.py2
-rw-r--r--src/sage/finance/time_series.pyx2
-rw-r--r--src/sage/graphs/strongly_regular_db.pyx2
-rw-r--r--src/sage/interfaces/sage0.py2
-rw-r--r--src/sage/libs/singular/ring.pyx2
-rw-r--r--src/sage/misc/c3_controlled.pyx2
-rw-r--r--src/sage/misc/citation.pyx5
-rw-r--r--src/sage/misc/fpickle.pyx4
-rw-r--r--src/sage/misc/latex.py2
-rw-r--r--src/sage/misc/lazy_attribute.pyx2
-rw-r--r--src/sage/misc/lazy_import.pyx2
-rw-r--r--src/sage/modular/modsym/p1list.pyx2
-rw-r--r--src/sage/modules/free_module_element.pyx4
-rw-r--r--src/sage/quivers/paths.pyx2
-rw-r--r--src/sage/rings/finite_rings/hom_finite_field.pyx14
-rw-r--r--src/sage/rings/integer.pyx2
-rw-r--r--src/sage/rings/number_field/number_field_element.pyx5
-rw-r--r--src/sage/rings/rational.pyx2
-rw-r--r--src/sage/sets/disjoint_set.pyx8
-rw-r--r--src/sage/stats/intlist.pyx2
-rw-r--r--src/sage/structure/category_object.pyx6
-rw-r--r--src/sage/structure/element.pyx2
-rw-r--r--src/sage/structure/factory.pyx2
-rw-r--r--src/sage/structure/list_clone.pyx16
-rw-r--r--src/sage/symbolic/getitem.pyx2
34 files changed, 85 insertions, 58 deletions
diff --git a/src/doc/en/developer/coding_in_cython.rst b/src/doc/en/developer/coding_in_cython.rst
index 1a84692..5c6ee9a 100644
--- a/src/doc/en/developer/coding_in_cython.rst
+++ b/src/doc/en/developer/coding_in_cython.rst
@@ -213,7 +213,7 @@ original object. As an example, the following code snippet is the
sage: n = 5
sage: t = n.__reduce__(); t
- (<built-in function make_integer>, ('5',))
+ (<cyfunction make_integer at ...>, ('5',))
sage: t[0](*t[1])
5
sage: loads(dumps(n)) == n
diff --git a/src/doc/en/prep/Programming.rst b/src/doc/en/prep/Programming.rst
index cafca74..420534e 100644
--- a/src/doc/en/prep/Programming.rst
+++ b/src/doc/en/prep/Programming.rst
@@ -102,14 +102,17 @@ Then we do the row\-reduced echelon form.
It is very important to keep in the parentheses.
.. note::
- Things that would be legal without them would be called 'attributes',
- but Sage prefers stylistically to hide them, since math is made of functions
- and not elements of sets. Or so a category\-theorist would say.
- ::
+ Things that would be legal without them would be called 'attributes',
+ but Sage prefers stylistically to hide them, since math is made of
+ functions and not elements of sets.
+ Or so a category-theorist would say.
+
+ ::
- sage: A.det # Won't work
- <built-in method det of sage.matrix.matrix_integer_dense.Matrix_integer_dense object at ...>
+ sage: A.det # Won't work
+ <bound method Matrix_integer_dense.det of [1 2]
+ [3 4]>
This is so useful because we can use the 'tab' key, remember!
diff --git a/src/doc/en/prep/Symbolics-and-Basic-Plotting.rst b/src/doc/en/prep/Symbolics-and-Basic-Plotting.rst
index 01df754..42cff14 100644
--- a/src/doc/en/prep/Symbolics-and-Basic-Plotting.rst
+++ b/src/doc/en/prep/Symbolics-and-Basic-Plotting.rst
@@ -199,7 +199,7 @@ This is a good place for a few reminders of basic help.
::
sage: z.simplify
- <built-in method simplify of sage.symbolic.expression.Expression object at ...>
+ <bound method Expression.simplify of -((x + 1)*sqrt(x - 1) - (x - 1)^(3/2))/sqrt((x + 1)*(x - 1))>
Finally, recall that you can get nicely typeset versions of the output
in several ways.
diff --git a/src/doc/en/thematic_tutorials/coercion_and_categories.rst b/src/doc/en/thematic_tutorials/coercion_and_categories.rst
index 19e05d8..55258c9 100644
--- a/src/doc/en/thematic_tutorials/coercion_and_categories.rst
+++ b/src/doc/en/thematic_tutorials/coercion_and_categories.rst
@@ -466,9 +466,9 @@ And indeed, ``MS2`` has *more* methods than ``MS1``::
sage: import inspect
sage: len([s for s in dir(MS1) if inspect.ismethod(getattr(MS1,s,None))])
- 78
+ 197
sage: len([s for s in dir(MS2) if inspect.ismethod(getattr(MS2,s,None))])
- 118
+ 237
This is because the class of ``MS2`` also inherits from the parent
class for algebras::
diff --git a/src/sage/__init__.py b/src/sage/__init__.py
index 28a1e84..50f33e5 100644
--- a/src/sage/__init__.py
+++ b/src/sage/__init__.py
@@ -30,11 +30,16 @@ def isfunction(obj):
True
sage: from sage.categories.coercion_methods import _mul_parent
sage: isfunction(_mul_parent)
+ sage: from sage.structure.richcmp import rich_to_bool
+ sage: isfunction(rich_to_bool)
True
sage: isfunction(Integer.digits) # unbound method
False
sage: isfunction(Integer(1).digits) # bound method
False
+ sage: from sage.geometry.point_collection import PointCollection
+ sage: isfunction(PointCollection.output_format) # static method
+ True
"""
# We use type(obj) instead of just obj to avoid __getattr__().
# Some types, like methods, will return the __code__ of the
diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py
index 2fbf2d5..ad3e690 100644
--- a/src/sage/arith/misc.py
+++ b/src/sage/arith/misc.py
@@ -1854,9 +1854,9 @@ def get_gcd(order):
EXAMPLES::
sage: sage.arith.misc.get_gcd(4000)
- <built-in method gcd_int of sage.rings.fast_arith.arith_int object at ...>
+ <bound method arith_int.gcd_int of <sage.rings.fast_arith.arith_int object at ...>>
sage: sage.arith.misc.get_gcd(400000)
- <built-in method gcd_longlong of sage.rings.fast_arith.arith_llong object at ...>
+ <bound method arith_llong.gcd_longlong of <sage.rings.fast_arith.arith_llong object at ...>>
sage: sage.arith.misc.get_gcd(4000000000)
<function gcd at ...>
"""
@@ -1875,9 +1875,9 @@ def get_inverse_mod(order):
EXAMPLES::
sage: sage.arith.misc.get_inverse_mod(6000)
- <built-in method inverse_mod_int of sage.rings.fast_arith.arith_int object at ...>
+ <bound method arith_int.inverse_mod_int of <sage.rings.fast_arith.arith_int object at ...>>
sage: sage.arith.misc.get_inverse_mod(600000)
- <built-in method inverse_mod_longlong of sage.rings.fast_arith.arith_llong object at ...>
+ <bound method arith_llong.inverse_mod_longlong of <sage.rings.fast_arith.arith_llong object at ...>>
sage: sage.arith.misc.get_inverse_mod(6000000000)
<function inverse_mod at ...>
"""
diff --git a/src/sage/categories/category.py b/src/sage/categories/category.py
index 9b9117a..c59f353 100644
--- a/src/sage/categories/category.py
+++ b/src/sage/categories/category.py
@@ -2204,7 +2204,7 @@ class Category(UniqueRepresentation, SageObject):
"""
return self
- _flatten_categories = _flatten_categories
+ _flatten_categories = staticmethod(_flatten_categories) # a cythonised helper
@staticmethod
def _sort(categories):
@@ -2253,7 +2253,7 @@ class Category(UniqueRepresentation, SageObject):
"""
return tuple(sorted(categories, key=category_sort_key, reverse=True))
- _sort_uniq = _sort_uniq # a cythonised helper
+ _sort_uniq = staticmethod(_sort_uniq) # a cythonised helper
def __and__(self, other):
"""
diff --git a/src/sage/categories/modules.py b/src/sage/categories/modules.py
index eecd907..e14cb24 100644
--- a/src/sage/categories/modules.py
+++ b/src/sage/categories/modules.py
@@ -589,6 +589,7 @@ class Modules(Category_module):
:meth:`sage.structure.category_object.CategoryObject.base_ring`::
sage: H.base_ring.__module__
+ 'sage.structure.category_object'
Here we call it directly::
diff --git a/src/sage/categories/primer.py b/src/sage/categories/primer.py
index 9926cd3..b5c6ada 100644
--- a/src/sage/categories/primer.py
+++ b/src/sage/categories/primer.py
@@ -912,12 +912,10 @@ Where do all the operations on ``S`` and its elements come from?
sage: x = S('a')
``_repr_`` is a technical method which comes with the data structure
-(:class:`ElementWrapper`); since it's implemented in Cython, we need
-to use Sage's introspection tools to recover where it's implemented::
+(:class:`ElementWrapper`)::
sage: x._repr_.__module__
- sage: sage.misc.sageinspect.sage_getfile(x._repr_)
- '.../sage/structure/element_wrapper.pyx'
+ 'sage.structure.element_wrapper'
``__pow__`` is a generic method for all finite semigroups::
diff --git a/src/sage/combinat/sf/classical.py b/src/sage/combinat/sf/classical.py
index c0af8d5..115da27 100644
--- a/src/sage/combinat/sf/classical.py
+++ b/src/sage/combinat/sf/classical.py
@@ -54,7 +54,7 @@ def init():
sage: sage.combinat.sf.classical.conversion_functions = {}
sage: init()
sage: sage.combinat.sf.classical.conversion_functions[('Schur', 'powersum')]
- <built-in function t_SCHUR_POWSYM_symmetrica>
+ <cyfunction t_SCHUR_POWSYM_symmetrica at ...>
The following checks if the bug described in :trac:`15312` is fixed.::
diff --git a/src/sage/finance/time_series.pyx b/src/sage/finance/time_series.pyx
index e1e4bd6..0e72b45 100644
--- a/src/sage/finance/time_series.pyx
+++ b/src/sage/finance/time_series.pyx
@@ -176,7 +176,7 @@ cdef class TimeSeries:
sage: v = finance.TimeSeries([1,-3.5])
sage: v.__reduce__()
- (<built-in function unpickle_time_series_v1>, (..., 2))
+ (<cyfunction unpickle_time_series_v1 at ...>, (..., 2))
sage: loads(dumps(v)) == v
True
diff --git a/src/sage/graphs/strongly_regular_db.pyx b/src/sage/graphs/strongly_regular_db.pyx
index 19aa6e2..90ec448 100644
--- a/src/sage/graphs/strongly_regular_db.pyx
+++ b/src/sage/graphs/strongly_regular_db.pyx
@@ -1148,7 +1148,7 @@ def is_RSHCD(int v,int k,int l,int mu):
sage: from sage.graphs.strongly_regular_db import is_RSHCD
sage: t = is_RSHCD(64,27,10,12); t
- [<built-in function SRG_from_RSHCD>, 64, 27, 10, 12]
+ [<cyfunction SRG_from_RSHCD at ...>, 64, 27, 10, 12]
sage: g = t[0](*t[1:]); g
Graph on 64 vertices
sage: g.is_strongly_regular(parameters=True)
diff --git a/src/sage/interfaces/sage0.py b/src/sage/interfaces/sage0.py
index 4ba76ab..cccbedb 100644
--- a/src/sage/interfaces/sage0.py
+++ b/src/sage/interfaces/sage0.py
@@ -496,7 +496,7 @@ class SageFunction(FunctionElement):
EXAMPLES::
sage: sage0(4).gcd
- <built-in method gcd of sage.rings.integer.Integer object at 0x...>
+ <bound method Integer.gcd of 4>
"""
return str(self._obj.parent().eval('%s.%s' % (self._obj._name,
self._name)))
diff --git a/src/sage/libs/singular/ring.pyx b/src/sage/libs/singular/ring.pyx
index 87e27f5..370b6a1 100644
--- a/src/sage/libs/singular/ring.pyx
+++ b/src/sage/libs/singular/ring.pyx
@@ -631,7 +631,7 @@ cpdef poison_currRing(frame, event, arg):
sage: from sage.libs.singular.ring import poison_currRing
sage: sys.settrace(poison_currRing)
sage: sys.gettrace()
- <built-in function poison_currRing>
+ <cyfunction poison_currRing at ...>
sage: sys.settrace(previous_trace_func) # switch it off again
"""
global currRing
diff --git a/src/sage/misc/c3_controlled.pyx b/src/sage/misc/c3_controlled.pyx
index 081c0a4..e5b114e 100644
--- a/src/sage/misc/c3_controlled.pyx
+++ b/src/sage/misc/c3_controlled.pyx
@@ -1090,7 +1090,7 @@ class HierarchyElement(object, metaclass=ClasscallMetaclass):
sage: x._bases
[5, 2]
sage: x._key
- <built-in function identity>
+ <cyfunction identity at ...>
sage: x._key(10)
10
diff --git a/src/sage/misc/citation.pyx b/src/sage/misc/citation.pyx
index c348dd3..111c16d 100644
--- a/src/sage/misc/citation.pyx
+++ b/src/sage/misc/citation.pyx
@@ -80,8 +80,9 @@ def get_systems(cmd):
sage: get_systems('I.primary_decomposition()')
['Singular']
- sage: a = var('a')
- sage: get_systems('((a+1)^2).expand()')
+ sage: var('a')
+ a
+ sage: get_systems('((a+1)^2).expand()') # random (needs SAGE_PROFILE=yes)
['ginac']
"""
import cProfile, pstats, re
diff --git a/src/sage/misc/fpickle.pyx b/src/sage/misc/fpickle.pyx
index c6d0d74..3cec5cf 100644
--- a/src/sage/misc/fpickle.pyx
+++ b/src/sage/misc/fpickle.pyx
@@ -18,7 +18,7 @@ def code_ctor(*args):
sage: def foo(a,b,c=10): return a+b+c
sage: sage.misc.fpickle.reduce_code(foo.__code__)
- (<built-in function code_ctor>, ...)
+ (<cyfunction code_ctor at ...>, ...)
sage: unpickle_function(pickle_function(foo))
<function foo at ...>
"""
@@ -30,7 +30,7 @@ def reduce_code(co):
sage: def foo(N): return N+1
sage: sage.misc.fpickle.reduce_code(foo.__code__)
- (<built-in function code_ctor>, ...)
+ (<cyfunction code_ctor at ...>, ...)
"""
if co.co_freevars or co.co_cellvars:
raise ValueError("Cannot pickle code objects from closures")
diff --git a/src/sage/misc/latex.py b/src/sage/misc/latex.py
index b358f39..00c7f33 100644
--- a/src/sage/misc/latex.py
+++ b/src/sage/misc/latex.py
@@ -557,7 +557,7 @@ def has_latex_attr(x):
sage: T._latex_()
Traceback (most recent call last):
...
- TypeError: descriptor '_latex_' of 'sage.matrix.matrix0.Matrix' object needs an argument
+ TypeError: unbound method cython_function_or_method object must be called with Matrix_integer_dense instance as first argument (got nothing instead)
sage: has_latex_attr(T)
False
"""
diff --git a/src/sage/misc/lazy_attribute.pyx b/src/sage/misc/lazy_attribute.pyx
index 0663610..4fe13bd 100644
--- a/src/sage/misc/lazy_attribute.pyx
+++ b/src/sage/misc/lazy_attribute.pyx
@@ -72,7 +72,7 @@ cdef class _lazy_attribute(object):
sage: Parent.element_class.__name__
'element_class'
sage: Parent.element_class.__module__
- 'sage.misc.lazy_attribute'
+ 'sage.structure.parent'
"""
raise NotImplementedError("Only instantiate wrapper python class")
diff --git a/src/sage/misc/lazy_import.pyx b/src/sage/misc/lazy_import.pyx
index adc0821..60c9728 100644
--- a/src/sage/misc/lazy_import.pyx
+++ b/src/sage/misc/lazy_import.pyx
@@ -316,7 +316,7 @@ cdef class LazyImport(object):
sage: from sage.misc.lazy_import import LazyImport
sage: my_integer = LazyImport('sage.rings.all', 'Integer')
- sage: my_integer.sqrt is Integer.sqrt
+ sage: my_integer.sqrt == Integer.sqrt
True
"""
return getattr(self.get_object(), attr)
diff --git a/src/sage/modular/modsym/p1list.pyx b/src/sage/modular/modsym/p1list.pyx
index e7c8536..4c293a0 100644
--- a/src/sage/modular/modsym/p1list.pyx
+++ b/src/sage/modular/modsym/p1list.pyx
@@ -771,7 +771,7 @@ cdef class P1List:
sage: L = P1List(8)
sage: L.__reduce__()
- (<built-in function _make_p1list>, (8,))
+ (<cyfunction _make_p1list at ...>, (8,))
"""
import sage.modular.modsym.p1list
return sage.modular.modsym.p1list._make_p1list, (self.__N, )
diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
index 620f868..73bfa40 100644
--- a/src/sage/modules/free_module_element.pyx
+++ b/src/sage/modules/free_module_element.pyx
@@ -4214,7 +4214,7 @@ cdef class FreeModuleElement_generic_dense(FreeModuleElement):
sage: v = vector([-1,0,3,pi])
sage: v.__reduce__()
- (<built-in function make_FreeModuleElement_generic_dense_v1>, (Vector space of dimension 4 over Symbolic Ring, [-1, 0, 3, pi], 4, True))
+ (<cyfunction make_FreeModuleElement_generic_dense_v1 at ...>, (Vector space of dimension 4 over Symbolic Ring, [-1, 0, 3, pi], 4, True))
"""
return (make_FreeModuleElement_generic_dense_v1, (self._parent, self._entries, self._degree, self._is_mutable))
@@ -4761,7 +4761,7 @@ cdef class FreeModuleElement_generic_sparse(FreeModuleElement):
sage: v = vector([1,2/3,pi], sparse=True)
sage: v.__reduce__()
- (<built-in function make_FreeModuleElement_generic_sparse_v1>, (Sparse vector space of dimension 3 over Symbolic Ring, {0: 1, 1: 2/3, 2: pi}, 3, True))
+ (<cyfunction make_FreeModuleElement_generic_sparse_v1 at ...>, (Sparse vector space of dimension 3 over Symbolic Ring, {0: 1, 1: 2/3, 2: pi}, 3, True))
"""
return (make_FreeModuleElement_generic_sparse_v1, (self._parent, self._entries, self._degree, self._is_mutable))
diff --git a/src/sage/quivers/paths.pyx b/src/sage/quivers/paths.pyx
index 4e30ea3..47fe46a 100644
--- a/src/sage/quivers/paths.pyx
+++ b/src/sage/quivers/paths.pyx
@@ -812,7 +812,7 @@ cpdef QuiverPath NewQuiverPath(Q, start, end, biseq_data):
sage: loads(dumps(p)) == p # indirect doctest
True
sage: p.__reduce__()
- (<...NewQuiverPath>,
+ (<cyfunction NewQuiverPath at ...>,
(Partial semigroup formed by the directed paths of Multi-digraph on 3 vertices,
1,
3,
diff --git a/src/sage/rings/finite_rings/hom_finite_field.pyx b/src/sage/rings/finite_rings/hom_finite_field.pyx
index 4e2affc..d23ea3d 100644
--- a/src/sage/rings/finite_rings/hom_finite_field.pyx
+++ b/src/sage/rings/finite_rings/hom_finite_field.pyx
@@ -93,13 +93,16 @@ AUTHOR:
- Xavier Caruso (2012-06-29)
"""
-#############################################################################
-# Copyright (C) 2012 Xavier Caruso <xavier.caruso@normalesup.org>
-#
-# Distributed under the terms of the GNU General Public License (GPL)
+#*****************************************************************************
+# Copyright (C) 2012 Xavier Caruso <xavier.caruso@normalesup.org>
#
+# This program is free software: you can redistribute it and/or modify
+# 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/
-#****************************************************************************
+#*****************************************************************************
+
from __future__ import absolute_import
from sage.rings.integer cimport Integer
@@ -308,7 +311,6 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
"""
return self.domain().cardinality() == self.codomain().cardinality()
-
@cached_method
def section(self):
"""
diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
index 9d76afd..862323b 100644
--- a/src/sage/rings/integer.pyx
+++ b/src/sage/rings/integer.pyx
@@ -726,7 +726,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
sage: n = 5
sage: t = n.__reduce__(); t
- (<built-in function make_integer>, ('5',))
+ (<cyfunction make_integer at ...>, ('5',))
sage: t[0](*t[1])
5
sage: loads(dumps(n)) == n
diff --git a/src/sage/rings/number_field/number_field_element.pyx b/src/sage/rings/number_field/number_field_element.pyx
index fdceffd..da80a04 100644
--- a/src/sage/rings/number_field/number_field_element.pyx
+++ b/src/sage/rings/number_field/number_field_element.pyx
@@ -415,7 +415,10 @@ cdef class NumberFieldElement(FieldElement):
sage: k.<a> = NumberField(x^3 - 17*x^2 + 1)
sage: t = a.__reduce__(); t
- (<built-in function __create__NumberFieldElement_version1>, (Number Field in a with defining polynomial x^3 - 17*x^2 + 1, <type 'sage.rings.number_field.number_field_element.NumberFieldElement_absolute'>, x))
+ (<cyfunction __create__NumberFieldElement_version1 at ...>,
+ (Number Field in a with defining polynomial x^3 - 17*x^2 + 1,
+ <type 'sage.rings.number_field.number_field_element.NumberFieldElement_absolute'>,
+ x))
sage: t[0](*t[1]) == a
True
"""
diff --git a/src/sage/rings/rational.pyx b/src/sage/rings/rational.pyx
index 23360b1..f8a2f18 100644
--- a/src/sage/rings/rational.pyx
+++ b/src/sage/rings/rational.pyx
@@ -481,7 +481,7 @@ cdef class Rational(sage.structure.element.FieldElement):
sage: a = 3/5
sage: a.__reduce__()
- (<built-in function make_rational>, ('3/5',))
+ (<cyfunction make_rational at ...>, ('3/5',))
"""
return sage.rings.rational.make_rational, (self.str(32),)
diff --git a/src/sage/sets/disjoint_set.pyx b/src/sage/sets/disjoint_set.pyx
index 595068c..462ca55 100644
--- a/src/sage/sets/disjoint_set.pyx
+++ b/src/sage/sets/disjoint_set.pyx
@@ -358,14 +358,14 @@ cdef class DisjointSet_of_integers(DisjointSet_class):
sage: d = DisjointSet(5)
sage: d.__reduce__()
- (<built-in function DisjointSet>, (5,), [0, 1, 2, 3, 4])
+ (<cyfunction DisjointSet at ...>, (5,), [0, 1, 2, 3, 4])
::
sage: d.union(2,4)
sage: d.union(1,3)
sage: d.__reduce__()
- (<built-in function DisjointSet>, (5,), [0, 1, 2, 1, 2])
+ (<cyfunction DisjointSet at ...>, (5,), [0, 1, 2, 1, 2])
"""
return DisjointSet, (self._nodes.degree,), self.__getstate__()
@@ -674,7 +674,7 @@ cdef class DisjointSet_of_hashables(DisjointSet_class):
{{0}, {1}, {2}, {3}, {4}}
sage: d = _
sage: d.__reduce__()
- (<built-in function DisjointSet>,
+ (<cyfunction DisjointSet at ...>,
([0, 1, 2, 3, 4],),
[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)])
@@ -683,7 +683,7 @@ cdef class DisjointSet_of_hashables(DisjointSet_class):
sage: d.union(2,4)
sage: d.union(1,3)
sage: d.__reduce__()
- (<built-in function DisjointSet>,
+ (<cyfunction DisjointSet at ...>,
([0, 1, 2, 3, 4],),
[(0, 0), (1, 1), (2, 2), (3, 1), (4, 2)])
"""
diff --git a/src/sage/stats/intlist.pyx b/src/sage/stats/intlist.pyx
index 7c7dab6..eeda942 100644
--- a/src/sage/stats/intlist.pyx
+++ b/src/sage/stats/intlist.pyx
@@ -288,7 +288,7 @@ cdef class IntList:
sage: v = stats.IntList([1,-3])
sage: v.__reduce__()
- (<built-in function unpickle_intlist_v1>, ('...', 2))
+ (<cyfunction unpickle_intlist_v1 at ...>, ('...', 2))
sage: loads(dumps(v)) == v
True
diff --git a/src/sage/structure/category_object.pyx b/src/sage/structure/category_object.pyx
index 45223ba..5affec9 100644
--- a/src/sage/structure/category_object.pyx
+++ b/src/sage/structure/category_object.pyx
@@ -566,7 +566,7 @@ cdef class CategoryObject(SageObject):
sage: F.base_ring()
Integer Ring
sage: F.__class__.base_ring
- <method 'base_ring' of 'sage.structure.category_object.CategoryObject' objects>
+ <unbound method FreeModule_ambient_pid_with_category.base_ring>
Note that the coordinates of the elements of a module can lie
in a bigger ring, the ``coordinate_ring``::
@@ -586,7 +586,7 @@ cdef class CategoryObject(SageObject):
sage: F.base_ring()
Rational Field
sage: F.__class__.base_ring
- <method 'base_ring' of 'sage.structure.category_object.CategoryObject' objects>
+ <unbound method FreeAlgebra_generic_with_category.base_ring>
sage: E = CombinatorialFreeModule(ZZ, [1,2,3])
sage: F = CombinatorialFreeModule(ZZ, [2,3,4])
@@ -594,7 +594,7 @@ cdef class CategoryObject(SageObject):
sage: H.base_ring()
Integer Ring
sage: H.__class__.base_ring
- <method 'base_ring' of 'sage.structure.category_object.CategoryObject' objects>
+ <unbound method Homset_with_category_with_equality_by_id.base_ring>
.. TODO::
diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
index 7575136..2918690 100644
--- a/src/sage/structure/element.pyx
+++ b/src/sage/structure/element.pyx
@@ -274,6 +274,7 @@ continue down the MRO and find the ``_add_`` method in the category.
from __future__ import absolute_import, division, print_function
+cimport cython
from libc.limits cimport LONG_MAX, LONG_MIN
from cpython cimport *
@@ -370,6 +371,7 @@ cdef class Element(SageObject):
.. automethod:: __floordiv__
.. automethod:: __mod__
"""
+ @cython.binding(False)
def __getmetaclass__(_):
from sage.misc.inherit_comparison import InheritComparisonMetaclass
return InheritComparisonMetaclass
diff --git a/src/sage/structure/factory.pyx b/src/sage/structure/factory.pyx
index e486d4f..2c57faa 100644
--- a/src/sage/structure/factory.pyx
+++ b/src/sage/structure/factory.pyx
@@ -543,7 +543,7 @@ cdef class UniqueFactory(SageObject):
sage: a = test_factory(1, 2)
Making object (1, 2)
sage: test_factory.reduce_data(a)
- (<built-in function generic_factory_unpickle>,
+ (<cyfunction generic_factory_unpickle at ...>,
(<class 'sage.structure.test_factory.UniqueFactoryTester'>,
(...),
(1, 2),
diff --git a/src/sage/structure/list_clone.pyx b/src/sage/structure/list_clone.pyx
index 6102fcd..cf0b7bf 100644
--- a/src/sage/structure/list_clone.pyx
+++ b/src/sage/structure/list_clone.pyx
@@ -938,7 +938,13 @@ cdef class ClonableArray(ClonableElement):
sage: loads(dumps(el))
[1, 2, 4]
sage: t = el.__reduce__(); t
- (<built-in function _make_array_clone>, (<type 'sage.structure.list_clone_demo.IncreasingArray'>, <class 'sage.structure.list_clone_demo.IncreasingArrays_with_category'>, [1, 2, 4], True, True, None))
+ (<cyfunction _make_array_clone at ...>,
+ (<type 'sage.structure.list_clone_demo.IncreasingArray'>,
+ <class 'sage.structure.list_clone_demo.IncreasingArrays_with_category'>,
+ [1, 2, 4],
+ True,
+ True,
+ None))
sage: t[0](*t[1])
[1, 2, 4]
"""
@@ -1718,7 +1724,13 @@ cdef class ClonableIntArray(ClonableElement):
sage: loads(dumps(el))
[1, 2, 4]
sage: t = el.__reduce__(); t
- (<built-in function _make_int_array_clone>, (<type 'sage.structure.list_clone_demo.IncreasingIntArray'>, <class 'sage.structure.list_clone_demo.IncreasingIntArrays_with_category'>, [1, 2, 4], True, True, None))
+ (<cyfunction _make_int_array_clone at ...>,
+ (<type 'sage.structure.list_clone_demo.IncreasingIntArray'>,
+ <class 'sage.structure.list_clone_demo.IncreasingIntArrays_with_category'>,
+ [1, 2, 4],
+ True,
+ True,
+ None))
sage: t[0](*t[1])
[1, 2, 4]
"""
diff --git a/src/sage/symbolic/getitem.pyx b/src/sage/symbolic/getitem.pyx
index 5f6605a..2d6c00f 100644
--- a/src/sage/symbolic/getitem.pyx
+++ b/src/sage/symbolic/getitem.pyx
@@ -179,7 +179,7 @@ cdef class OperandsWrapper(SageObject):
TESTS::
sage: (x^2).op.__reduce__()
- (<built-in function restore_op_wrapper>, (x^2,))
+ (<cyfunction restore_op_wrapper at ...>, (x^2,))
sage: loads(dumps((x^2).op))
Operands of x^2
"""