Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
cython
Commits
7c022bd9
Commit
7c022bd9
authored
5 years ago
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cypclass type inference unit test
parent
1752ae4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
nogil_test/cypclass_test_type_inference.pyx
nogil_test/cypclass_test_type_inference.pyx
+26
-0
nogil_test/cypclass_test_type_inference_distutil.py
nogil_test/cypclass_test_type_inference_distutil.py
+15
-0
No files found.
nogil_test/cypclass_test_type_inference.pyx
0 → 100644
View file @
7c022bd9
cdef
cypclass
SomeMemory
:
int
a
void
__init__
(
self
,
int
a
=
0
):
self
.
a
=
a
SomeMemory
__add__
(
self
,
SomeMemory
other
):
return
SomeMemory
(
self
.
a
+
other
.
a
)
SomeMemory
__iadd__
(
self
,
SomeMemory
other
):
self
.
a
+=
other
.
a
SomeMemory
__mul__
(
self
,
SomeMemory
other
):
return
SomeMemory
(
self
.
a
*
other
.
a
)
cdef
cypclass
SomeSubMemory
(
SomeMemory
):
int
b
cpdef
bag
():
o1
=
SomeMemory
()
o2
=
SomeMemory
(
4
)
o3
=
SomeSubMemory
(
3
)
o3
+=
o2
o1
=
o2
*
o3
return
str
(
o1
.
a
)
+
'
\
n
'
+
str
(
o2
.
a
)
+
'
\
n
'
+
str
(
o3
.
a
)
This diff is collapsed.
Click to expand it.
nogil_test/cypclass_test_type_inference_distutil.py
0 → 100644
View file @
7c022bd9
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
Cython.Build
import
cythonize
setup
(
ext_modules
=
cythonize
([
Extension
(
'cypclass_test_type_inference'
,
language
=
'c++'
,
sources
=
[
'cypclass_test_type_inference.pyx'
],
extra_compile_args
=
[
"-pthread"
,
"-std=c++11"
],
),
])
)
This diff is collapsed.
Click to expand it.
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