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

Commit 3bfcc88

Browse files
committed
24832: add doctest
1 parent ff8c672 commit 3bfcc88

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/sage/symbolic/function.pyx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,17 @@ cdef class BuiltinFunction(Function):
951951
sage: bar = BuiltinFunction(name='bar', alt_name='foo')
952952
sage: bar(A())
953953
'foo'
954+
955+
sage: class AFunction(BuiltinFunction):
956+
....: def __init__(self):
957+
....: BuiltinFunction.__init__(self, name='sin', nargs=1)
958+
....: def extend_for(self, arg):
959+
....: return arg > 1
960+
sage: odd_sin = AFunction()
961+
sage: parent(odd_sin(0.0))
962+
Real Field with 53 bits of precision
963+
sage: parent(odd_sin(2.0))
964+
Complex Field with 53 bits of precision
954965
"""
955966
res = None
956967
if args and not hold:

0 commit comments

Comments
 (0)