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
7d9bf36f
Commit
7d9bf36f
authored
Oct 07, 2011
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make NotConstant a singleton & fix 2 fused py3k tests
parent
3f76e08f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+8
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+0
-2
tests/run/fused_def.pyx
tests/run/fused_def.pyx
+2
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
7d9bf36f
...
@@ -42,8 +42,14 @@ except ImportError:
...
@@ -42,8 +42,14 @@ except ImportError:
basestring
=
str
# Python 3
basestring
=
str
# Python 3
class
NotConstant
(
object
):
class
NotConstant
(
object
):
def
__deepcopy__
(
self
,
memo
):
_obj
=
None
return
self
def
__new__
(
cls
):
if
NotConstant
.
_obj
is
None
:
NotConstant
.
_obj
=
super
(
NotConstant
,
cls
).
__new__
(
cls
)
return
NotConstant
.
_obj
def
__repr__
(
self
):
def
__repr__
(
self
):
return
"<NOT CONSTANT>"
return
"<NOT CONSTANT>"
...
...
Cython/Compiler/Nodes.py
View file @
7d9bf36f
...
@@ -2499,8 +2499,6 @@ def __pyx_fused_cpdef(signatures, args, kwargs):
...
@@ -2499,8 +2499,6 @@ def __pyx_fused_cpdef(signatures, args, kwargs):
return signatures[candidates[0]]
return signatures[candidates[0]]
"""
%
fmt_dict
"""
%
fmt_dict
# print fragment_code
fragment
=
TreeFragment
.
TreeFragment
(
fragment_code
,
level
=
'module'
)
fragment
=
TreeFragment
.
TreeFragment
(
fragment_code
,
level
=
'module'
)
# analyse the declarations of our fragment ...
# analyse the declarations of our fragment ...
...
...
tests/run/fused_def.pyx
View file @
7d9bf36f
...
@@ -94,7 +94,7 @@ def opt_func(fused_t obj, cython.floating myf = 1.2, cython.integral myi = 7):
...
@@ -94,7 +94,7 @@ def opt_func(fused_t obj, cython.floating myf = 1.2, cython.integral myi = 7):
Traceback (most recent call last):
Traceback (most recent call last):
...
...
TypeError: Function call with ambiguous argument types
TypeError: Function call with ambiguous argument types
>>> opt_func[ExtClassA, cy.float, long](object(), f)
>>> opt_func[ExtClassA, cy.float,
cy.
long](object(), f)
Traceback (most recent call last):
Traceback (most recent call last):
...
...
TypeError: Argument 'obj' has incorrect type (expected fused_def.ExtClassA, got object)
TypeError: Argument 'obj' has incorrect type (expected fused_def.ExtClassA, got object)
...
@@ -109,8 +109,7 @@ def test_opt_func():
...
@@ -109,8 +109,7 @@ def test_opt_func():
str object double long
str object double long
ham 5.60 4 5.60 9
ham 5.60 4 5.60 9
"""
"""
cdef
char
*
s
=
"ham"
opt_func
(
"ham"
,
f
,
entry4
)
opt_func
(
s
,
f
,
entry4
)
def
args_kwargs
(
fused_t
obj
,
cython
.
floating
myf
=
1.2
,
*
args
,
**
kwargs
):
def
args_kwargs
(
fused_t
obj
,
cython
.
floating
myf
=
1.2
,
*
args
,
**
kwargs
):
"""
"""
...
...
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