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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
190f01d5
Commit
190f01d5
authored
Mar 29, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Amend __new__ test
parent
f0fe2a22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
nogil_test/cypclass_test___new__.pyx
nogil_test/cypclass_test___new__.pyx
+22
-3
No files found.
nogil_test/cypclass_test___new__.pyx
View file @
190f01d5
...
...
@@ -2,15 +2,22 @@ cdef cypclass SomeMemory:
int
a
SomeMemory
__new__
(
f
):
o
=
<
SomeMemory
>
f
()
o
=
f
()
o
.
a
=
-
2
return
o
void
*
__new__
(
f
,
int
a
):
o
=
<
SomeMemory
>
f
()
o
=
f
()
o
.
a
=
a
return
<
void
*>
o
double
__new__
(
unused
,
int
a
,
double
b
):
return
a
*
b
SomeMemory
__new__
(
f
,
int
a
,
int
b
,
int
c
=
2
,
int
d
=
4
,
int
e
=
32
,
int
g
=
65
):
o
=
f
()
return
o
SomeMemory
__alloc__
():
return
new
SomeMemory
()
...
...
@@ -20,6 +27,9 @@ cdef cypclass SomeMemory:
void
__init__
(
self
,
int
a
):
pass
void
__init__
(
self
,
int
a
,
int
b
,
int
c
,
int
d
=
21
,
int
e
=
31
):
self
.
a
=
e
cdef
int
foo
():
cdef
SomeMemory
o
=
SomeMemory
()
return
o
.
a
...
...
@@ -28,5 +38,14 @@ cdef int bar():
cdef
SomeMemory
o
=
SomeMemory
(
3
)
return
o
.
a
cdef
int
baz
():
o
=
SomeMemory
(
3
,
2
,
1
,
0
)
return
o
.
a
cdef
double
baa
():
o
=
SomeMemory
.
__new__
(
SomeMemory
.
__alloc__
,
2
,
3.4
)
o
=
SomeMemory
.
__new__
(
NULL
,
2
,
3.4
)
return
o
cpdef
bag
():
return
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
\ No newline at end of file
return
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
+
'
\
n
'
+
str
(
baz
())
+
'
\
n
'
+
str
(
baa
())
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