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
Boxiang Sun
cython
Commits
c28ca950
Commit
c28ca950
authored
Mar 18, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ticket #241, better error for keywords in cdef functions.
parent
6d6ca164
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+5
-1
tests/errors/e_cdef_keywords_T241.pyx
tests/errors/e_cdef_keywords_T241.pyx
+19
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
c28ca950
...
...
@@ -2527,7 +2527,11 @@ class GeneralCallNode(CallNode):
self
.
keyword_args
.
analyse_types
(
env
)
if
self
.
starstar_arg
:
self
.
starstar_arg
.
analyse_types
(
env
)
self
.
function
=
self
.
function
.
coerce_to_pyobject
(
env
)
if
self
.
function
.
type
is
not
py_object_type
:
if
hasattr
(
self
.
function
,
'entry'
)
and
not
self
.
function
.
entry
.
as_variable
:
error
(
self
.
pos
,
"Keyword arguments not allowed in cdef functions."
)
else
:
self
.
function
=
self
.
function
.
coerce_to_pyobject
(
env
)
self
.
positional_args
=
\
self
.
positional_args
.
coerce_to_pyobject
(
env
)
if
self
.
starstar_arg
:
...
...
tests/errors/e_cdef_keywords_T241.pyx
0 → 100644
View file @
c28ca950
cdef
some_function
(
x
,
y
):
pass
cdef
class
A
:
cdef
some_method
(
self
,
x
,
y
=
1
):
pass
some_function
(
1
,
2
)
some_function
(
1
,
y
=
2
)
cdef
A
a
=
A
()
a
.
some_method
(
1
)
a
.
some_method
(
1
,
2
)
a
.
some_method
(
1
,
y
=
2
)
_ERRORS
=
u"""
:9:13: Keyword arguments not allowed in cdef functions.
:14:13: Keyword arguments not allowed in cdef functions.
"""
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