You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cython/simple-extension/README.md
+3-9
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,11 @@ Create a simple Cython module (you can name it e.g. `cyt_module.pyx`)
5
5
containing the following function:
6
6
```
7
7
def subtract(x, y):
8
-
return x - y
8
+
result = x - y
9
+
return result
9
10
```
10
11
11
-
Use the provided [setup.py](setup.py) for building the extension module.
12
+
Create then a **setup.py** for building the extension module.
12
13
Try to utilize the module e.g. as
13
14
```
14
15
from cyt_module import subtract
@@ -18,10 +19,3 @@ subtract(4.5, 2)
18
19
in interactive interpreter or in a simple script. Try different argument
19
20
types.
20
21
21
-
### Type declarations
22
-
23
-
Declare the function arguments as **int** and rebuild the extension (Note: if working with interactive interpreter you need to exit or reload the module).
24
-
What happens if you call now the subtract function with floating point
0 commit comments