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
Gwenaël Samain
cython
Commits
89b7f63b
Commit
89b7f63b
authored
Apr 09, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reflect wrapped __new__ logic in __new__ test
parent
deb92199
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
19 deletions
+33
-19
nogil_test/cypclass_test___new__.pyx
nogil_test/cypclass_test___new__.pyx
+33
-19
No files found.
nogil_test/cypclass_test___new__.pyx
View file @
89b7f63b
...
...
@@ -11,6 +11,30 @@ cdef cypclass SomeMemory:
o
.
a
=
-
2
return
o
void
__init__
(
self
):
this
.
a
+=
1
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
cypclass
SomeArgUnpacking
:
int
a
SomeArgUnpacking
__new__
(
f
,
int
a
,
int
b
,
int
c
,
int
d
=
21
,
int
e
=
31
):
o
=
f
()
return
o
void
__init__
(
self
,
int
a
,
int
b
,
int
c
=
2
,
int
d
=
4
,
int
e
=
32
,
int
g
=
65
):
self
.
a
=
e
cdef
cypclass
SomeNewTrick
:
int
a
void
*
__new__
(
f
,
int
a
):
o
=
f
()
o
.
a
=
a
...
...
@@ -20,40 +44,30 @@ cdef cypclass SomeMemory:
Cy_INCREF
(
<
CyObject
*>
o
)
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
()
void
__init__
(
self
,
int
a
,
int
b
,
int
c
,
int
d
=
21
,
int
e
=
31
):
self
.
a
=
e
void
__init__
(
self
):
this
.
a
+=
1
void
__init__
(
self
,
int
a
):
pass
cdef
cypclass
SomeNotInstanciable
:
double
__new__
(
unused
,
int
a
,
double
b
):
return
a
*
b
void
__init__
(
self
,
int
a
,
int
b
,
int
c
,
int
d
=
21
,
int
e
=
31
):
self
.
a
=
e
cdef
int
foo
():
o
=
SomeMemory
()
return
o
.
a
cdef
int
bar
():
o
=
SomeMemory
(
3
)
o
=
<
SomeNewTrick
>
SomeNewTrick
(
3
)
return
o
.
a
cdef
int
baz
():
o
=
Some
Memory
(
3
,
2
,
1
,
0
)
o
=
Some
ArgUnpacking
(
3
,
2
,
1
,
0
)
return
o
.
a
cdef
double
baa
():
o
=
Some
Memory
.
__new__
(
SomeMemory
.
__alloc__
,
2
,
3.4
)
o
=
Some
Memory
.
__new__
(
NULL
,
2
,
3.4
)
o
=
Some
NotInstanciable
.
__new__
(
SomeNotInstanciable
.
__alloc__
,
2
,
3.4
)
o
=
Some
NotInstanciable
.
__new__
(
NULL
,
2
,
3.4
)
return
o
cpdef
bag
():
...
...
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