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
ff35cf52
Commit
ff35cf52
authored
Dec 11, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crash when calling non-trivial type constructors
parent
1f0a5deb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-1
tests/run/clone_type.pyx
tests/run/clone_type.pyx
+14
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
ff35cf52
...
...
@@ -2471,7 +2471,9 @@ class SimpleCallNode(CallNode):
self
.
arg_tuple
=
TupleNode
(
self
.
pos
,
args
=
self
.
args
)
self
.
arg_tuple
.
analyse_types
(
env
)
self
.
args
=
None
if
func_type
is
Builtin
.
type_type
and
function
.
entry
.
is_builtin
and
\
if
func_type
is
Builtin
.
type_type
and
function
.
is_name
and
\
function
.
entry
and
\
function
.
entry
.
is_builtin
and
\
function
.
entry
.
name
in
Builtin
.
types_that_construct_their_instance
:
# calling a builtin type that returns a specific object type
if
function
.
entry
.
name
==
'float'
:
...
...
tests/run/clone_type.pyx
0 → 100644
View file @
ff35cf52
cdef
class
MyType
:
def
dup
(
self
):
"""
>>> x1 = MyType()
>>> isinstance(x1, MyType)
True
>>> x2 = x1.dup()
>>> isinstance(x2, MyType)
True
>>> x1 != x2
True
"""
cdef
MyType
clone
=
<
MyType
>
type
(
self
)()
return
clone
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