Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon-compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
typon
typon-compiler
Commits
4e07f391
Commit
4e07f391
authored
Nov 02, 2023
by
Tom Niget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add numpy to ext example
parent
9104072b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
typon/trans/tests/pyext.post.py
typon/trans/tests/pyext.post.py
+1
-1
typon/trans/tests/pyext.py
typon/trans/tests/pyext.py
+7
-2
No files found.
typon/trans/tests/pyext.post.py
View file @
4e07f391
import
pyext
import
pyext
print
(
"Imported:"
,
pyext
.
add
(
5
,
3
),
pyext
.
fibo
(
10
))
print
(
"Imported:"
,
pyext
.
add
(
5
,
3
),
pyext
.
fibo
(
10
),
pyext
.
squares
())
\ No newline at end of file
\ No newline at end of file
typon/trans/tests/pyext.py
View file @
4e07f391
# coding: utf-8
# coding: utf-8
# extension
# extension
def
add
(
x
,
y
):
import
numpy
as
np
def
add
(
x
,
y
)
->
int
:
return
x
+
y
return
x
+
y
def
fibo
(
n
):
def
fibo
(
n
):
...
@@ -10,5 +12,8 @@ def fibo(n):
...
@@ -10,5 +12,8 @@ def fibo(n):
res
.
append
(
res
[
i
-
1
]
+
res
[
i
-
2
])
res
.
append
(
res
[
i
-
1
]
+
res
[
i
-
2
])
return
res
return
res
def
squares
()
->
list
[
int
]:
return
np
.
square
([
x
for
x
in
range
(
5
)])
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
print
(
"Python:"
,
add
(
5
,
3
),
fibo
(
10
))
print
(
"Python:"
,
add
(
5
,
3
),
fibo
(
10
),
squares
())
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment