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
Kirill Smelkov
cython
Commits
9139a7f8
Commit
9139a7f8
authored
Apr 06, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support NULL as default argument in auto doc transform
parent
8a8c8d27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
Cython/Compiler/AutoDocTransforms.py
Cython/Compiler/AutoDocTransforms.py
+2
-0
tests/run/embedsignatures.pyx
tests/run/embedsignatures.pyx
+7
-0
No files found.
Cython/Compiler/AutoDocTransforms.py
View file @
9139a7f8
...
...
@@ -51,6 +51,8 @@ class EmbedSignature(CythonTransform):
default_val
=
arg
.
default
if
not
default_val
:
return
None
if
isinstance
(
default_val
,
ExprNodes
.
NullNode
):
return
'NULL'
try
:
denv
=
self
.
denv
# XXX
ctval
=
default_val
.
compile_time_value
(
self
.
denv
)
...
...
tests/run/embedsignatures.pyx
View file @
9139a7f8
...
...
@@ -199,6 +199,9 @@ __doc__ = ur"""
>>> print(funcdoc(f_defexpr5))
f_defexpr5(int x=4)
>>> print(funcdoc(f_charptr_null))
f_charptr_null(char *s=NULL) -> char *
"""
cdef
class
Ext
:
...
...
@@ -403,6 +406,10 @@ cpdef f_defexpr4(int x = (Ext.CONST1 + FLAG1) * Ext.CONST2):
cpdef
f_defexpr5
(
int
x
=
2
+
2
):
pass
cpdef
(
char
*
)
f_charptr_null
(
char
*
s
=
NULL
):
return
s
or
b'abc'
# no signatures for lambda functions
lambda_foo
=
lambda
x
:
10
lambda_bar
=
lambda
x
:
20
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