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
5f8b597e
Commit
5f8b597e
authored
Mar 29, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added optimize_simple_methods to make it possible to accept keywords in 1-arg functions
parent
f441bb7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
Cython/Compiler/Options.py
Cython/Compiler/Options.py
+5
-0
No files found.
Cython/Compiler/Nodes.py
View file @
5f8b597e
...
...
@@ -1252,7 +1252,7 @@ class DefNode(FuncDefNode):
any_type_tests_needed
=
0
# Use the simpler calling signature for zero- and one-argument functions.
if
not
self
.
entry
.
is_special
and
not
self
.
star_arg
and
not
self
.
starstar_arg
:
if
self
.
entry
.
signature
is
TypeSlots
.
pyfunction_signature
:
if
self
.
entry
.
signature
is
TypeSlots
.
pyfunction_signature
and
Options
.
optimize_simple_methods
:
if
len
(
self
.
args
)
==
0
:
self
.
entry
.
signature
=
TypeSlots
.
pyfunction_noargs
elif
len
(
self
.
args
)
==
1
:
...
...
Cython/Compiler/Options.py
View file @
5f8b597e
...
...
@@ -45,3 +45,8 @@ lookup_module_cpdef = 0
# checking for NULL on every use, and can decref rather than xdecref at the end.
# WARNING: This is a work in progress, may currently segfault.
init_local_none
=
1
# Optimize no argument and one argument methods by using the METH_O and METH_NOARGS
# calling conventions. These are faster calling conventions, but disallow the use of
# keywords (which, admittedly, are of little use in these cases).
optimize_simple_methods
=
1
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