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

Commit d962040

Browse files
committed
Sage library fixes for binding=True
1 parent c5a8bd3 commit d962040

File tree

17 files changed

+39
-31
lines changed

17 files changed

+39
-31
lines changed

src/doc/en/prep/Programming.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,17 @@ Then we do the row\-reduced echelon form.
102102
It is very important to keep in the parentheses.
103103

104104
.. note::
105-
Things that would be legal without them would be called 'attributes',
106-
but Sage prefers stylistically to hide them, since math is made of functions
107-
and not elements of sets. Or so a category\-theorist would say.
108105

109-
::
106+
Things that would be legal without them would be called 'attributes',
107+
but Sage prefers stylistically to hide them, since math is made of
108+
functions and not elements of sets.
109+
Or so a category-theorist would say.
110+
111+
::
110112

111-
sage: A.det # Won't work
112-
<built-in method det of sage.matrix.matrix_integer_dense.Matrix_integer_dense object at ...>
113+
sage: A.det # Won't work
114+
<bound method Matrix_integer_dense.det of [1 2]
115+
[3 4]>
113116

114117
This is so useful because we can use the 'tab' key, remember!
115118

src/doc/en/prep/Symbolics-and-Basic-Plotting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ This is a good place for a few reminders of basic help.
199199
::
200200

201201
sage: z.simplify
202-
<built-in method simplify of sage.symbolic.expression.Expression object at ...>
202+
<bound method Expression.simplify of -((x + 1)*sqrt(x - 1) - (x - 1)^(3/2))/sqrt((x + 1)*(x - 1))>
203203

204204
Finally, recall that you can get nicely typeset versions of the output
205205
in several ways.

src/doc/en/thematic_tutorials/coercion_and_categories.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ And indeed, ``MS2`` has *more* methods than ``MS1``::
452452
sage: len([s for s in dir(MS1) if inspect.ismethod(getattr(MS1,s,None))])
453453
79
454454
sage: len([s for s in dir(MS2) if inspect.ismethod(getattr(MS2,s,None))])
455-
118
455+
237
456456

457457
This is because the class of ``MS2`` also inherits from the parent
458458
class for algebras::

src/sage/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,16 @@ def isfunction(obj):
3535
sage: from sage.categories.coercion_methods import _mul_parent
3636
sage: isfunction(_mul_parent)
3737
True
38+
sage: from sage.structure.richcmp import rich_to_bool
39+
sage: isfunction(rich_to_bool)
40+
True
3841
sage: isfunction(Integer.digits) # unbound method
3942
False
4043
sage: isfunction(Integer(1).digits) # bound method
4144
False
45+
sage: from sage.geometry.point_collection import PointCollection
46+
sage: isfunction(PointCollection.output_format) # static method
47+
True
4248
4349
Verify that ipywidgets can correctly determine signatures of Cython
4450
functions::

src/sage/arith/misc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,9 +1870,9 @@ def get_gcd(order):
18701870
EXAMPLES::
18711871
18721872
sage: sage.arith.misc.get_gcd(4000)
1873-
<built-in method gcd_int of sage.rings.fast_arith.arith_int object at ...>
1873+
<bound method arith_int.gcd_int of <sage.rings.fast_arith.arith_int object at ...>>
18741874
sage: sage.arith.misc.get_gcd(400000)
1875-
<built-in method gcd_longlong of sage.rings.fast_arith.arith_llong object at ...>
1875+
<bound method arith_llong.gcd_longlong of <sage.rings.fast_arith.arith_llong object at ...>>
18761876
sage: sage.arith.misc.get_gcd(4000000000)
18771877
<function gcd at ...>
18781878
"""
@@ -1891,9 +1891,9 @@ def get_inverse_mod(order):
18911891
EXAMPLES::
18921892
18931893
sage: sage.arith.misc.get_inverse_mod(6000)
1894-
<built-in method inverse_mod_int of sage.rings.fast_arith.arith_int object at ...>
1894+
<bound method arith_int.inverse_mod_int of <sage.rings.fast_arith.arith_int object at ...>>
18951895
sage: sage.arith.misc.get_inverse_mod(600000)
1896-
<built-in method inverse_mod_longlong of sage.rings.fast_arith.arith_llong object at ...>
1896+
<bound method arith_llong.inverse_mod_longlong of <sage.rings.fast_arith.arith_llong object at ...>>
18971897
sage: sage.arith.misc.get_inverse_mod(6000000000)
18981898
<function inverse_mod at ...>
18991899
"""

src/sage/categories/modules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ def base_ring(self):
589589
:meth:`sage.structure.category_object.CategoryObject.base_ring`::
590590
591591
sage: H.base_ring.__module__
592+
'sage.structure.category_object'
592593
593594
Here we call it directly::
594595

src/sage/categories/primer.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -913,12 +913,10 @@ class SubcategoryMethods:
913913
sage: x = S('a')
914914
915915
``_repr_`` is a technical method which comes with the data structure
916-
(:class:`ElementWrapper`); since it's implemented in Cython, we need
917-
to use Sage's introspection tools to recover where it's implemented::
916+
(:class:`ElementWrapper`)::
918917
919918
sage: x._repr_.__module__
920-
sage: sage.misc.sageinspect.sage_getfile(x._repr_)
921-
'.../sage/structure/element_wrapper.pyx'
919+
'sage.structure.element_wrapper'
922920
923921
``_pow_int`` is a generic method for all finite semigroups::
924922

src/sage/combinat/sf/classical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def init():
5151
sage: sage.combinat.sf.classical.conversion_functions = {}
5252
sage: init()
5353
sage: sage.combinat.sf.classical.conversion_functions[('Schur', 'powersum')]
54-
<built-in function t_SCHUR_POWSYM_symmetrica>
54+
<cyfunction t_SCHUR_POWSYM_symmetrica at ...>
5555
5656
The following checks if the bug described in :trac:`15312` is fixed. ::
5757

src/sage/graphs/strongly_regular_db.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ def is_RSHCD(int v,int k,int l,int mu):
11481148

11491149
sage: from sage.graphs.strongly_regular_db import is_RSHCD
11501150
sage: t = is_RSHCD(64,27,10,12); t
1151-
[<built-in function SRG_from_RSHCD>, 64, 27, 10, 12]
1151+
[<cyfunction SRG_from_RSHCD at ...>, 64, 27, 10, 12]
11521152
sage: g = t[0](*t[1:]); g
11531153
Graph on 64 vertices
11541154
sage: g.is_strongly_regular(parameters=True)

src/sage/interfaces/sage0.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def _repr_(self):
556556
EXAMPLES::
557557
558558
sage: sage0(4).gcd
559-
<built-in method gcd of sage.rings.integer.Integer object at 0x...>
559+
<bound method Integer.gcd of 4>
560560
"""
561561
return str(self._obj.parent().eval('%s.%s' % (self._obj._name,
562562
self._name)))

0 commit comments

Comments
 (0)