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
f0472a34
Commit
f0472a34
authored
Aug 23, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments
parent
92b1ba43
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+3
-3
No files found.
Cython/Compiler/Nodes.py
View file @
f0472a34
...
@@ -1768,8 +1768,7 @@ class DefNode(FuncDefNode):
...
@@ -1768,8 +1768,7 @@ class DefNode(FuncDefNode):
code
.
putln
(
"Py_ssize_t kw_args = PyDict_Size(%s);"
%
code
.
putln
(
"Py_ssize_t kw_args = PyDict_Size(%s);"
%
Naming
.
kwds_cname
)
Naming
.
kwds_cname
)
# parse the tuple first, then start parsing the arg tuple and
# parse the tuple and check that there are not too many
# check that positional args are not also passed as kw args
code
.
putln
(
'switch (PyTuple_GET_SIZE(%s)) {'
%
Naming
.
args_cname
)
code
.
putln
(
'switch (PyTuple_GET_SIZE(%s)) {'
%
Naming
.
args_cname
)
for
i
in
range
(
max_positional_args
-
1
,
-
1
,
-
1
):
for
i
in
range
(
max_positional_args
-
1
,
-
1
,
-
1
):
code
.
putln
(
'case %d:'
%
(
i
+
1
))
code
.
putln
(
'case %d:'
%
(
i
+
1
))
...
@@ -1826,11 +1825,12 @@ class DefNode(FuncDefNode):
...
@@ -1826,11 +1825,12 @@ class DefNode(FuncDefNode):
# pure error case: keywords required but not passed
# pure error case: keywords required but not passed
code
.
putln
(
'} else {'
)
code
.
putln
(
'} else {'
)
if
not
self
.
star_arg
and
not
self
.
starstar_arg
:
if
not
self
.
star_arg
and
not
self
.
starstar_arg
:
# optional args missing?
self
.
generate_positional_args_check
(
self
.
generate_positional_args_check
(
max_positional_args
,
has_fixed_positional_count
,
code
)
max_positional_args
,
has_fixed_positional_count
,
code
)
# simple case: keywords required but none passed
for
i
,
arg
in
enumerate
(
kw_only_args
):
for
i
,
arg
in
enumerate
(
kw_only_args
):
if
not
arg
.
default
:
if
not
arg
.
default
:
# required keyword-only argument missing
code
.
put
(
'__Pyx_RaiseKeywordRequired("%s", *%s[%d]); '
%
(
code
.
put
(
'__Pyx_RaiseKeywordRequired("%s", *%s[%d]); '
%
(
self
.
name
.
utf8encode
(),
Naming
.
pykwdlist_cname
,
self
.
name
.
utf8encode
(),
Naming
.
pykwdlist_cname
,
len
(
positional_args
)
+
i
))
len
(
positional_args
)
+
i
))
...
...
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