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
8469d73b
Commit
8469d73b
authored
Feb 28, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments
parent
72bc351f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+8
-2
No files found.
Cython/Compiler/Nodes.py
View file @
8469d73b
...
...
@@ -2216,7 +2216,8 @@ class DefNode(FuncDefNode):
code
.
put_goto
(
argtuple_error_label
)
code
.
putln
(
'}'
)
# now fill up the required arguments with values from the kw dict
# now fill up the positional/required arguments with values
# from the kw dict
if
self
.
num_required_args
or
max_positional_args
>
0
:
last_required_arg
=
-
1
for
i
,
arg
in
enumerate
(
all_args
):
...
...
@@ -2240,7 +2241,7 @@ class DefNode(FuncDefNode):
code
.
putln
(
'if (kw_args > %d) {'
%
num_required_args
)
code
.
putln
(
'PyObject* value = PyDict_GetItem(%s, %s);'
%
(
Naming
.
kwds_cname
,
arg
.
name_entry
.
pystring_cname
))
code
.
putln
(
'if (unlikely(value)) { values[%d] = value; kw_args--; }'
%
i
)
;
code
.
putln
(
'if (unlikely(value)) { values[%d] = value; kw_args--; }'
%
i
)
code
.
putln
(
'}'
)
else
:
num_required_args
-=
1
...
...
@@ -2296,6 +2297,11 @@ class DefNode(FuncDefNode):
code
.
putln
(
'if (unlikely(kw_args > 0)) {'
)
# non-positional/-required kw args left in dict: default args,
# kw-only args, **kwargs or error
#
# This is sort of a catch-all: except for checking required
# arguments, this will always do the right thing for unpacking
# keyword arguments, so that we can concentrate on optimising
# common cases above.
if
max_positional_args
==
0
:
pos_arg_count
=
"0"
elif
self
.
star_arg
:
...
...
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