Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

r""" 

Ensure that ``functools.partial`` is correctly handled by 

:func:`~sage.misc.sageinspect.sage_getsourcelines`. 

""" 

from functools import partial 

 

def base(x): 

""" 

Test function to make sure 

:func:`~sage.misc.sageinspect.sage_getsourcelines` can get 

the code of a function created by ``functools.partial``. 

 

EXAMPLES:: 

 

sage: from sage.tests.functools_partial_src import base, test_func 

sage: base(3) 

21 

sage: test_func() 

42 

""" 

x = x * 7 

return x 

 

test_func = partial(base, 6)