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
05d0a375
Commit
05d0a375
authored
Jan 13, 2009
by
Jason Evans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print default arguments syntactically, in order to (for example) preserve
quotes around strings.
parent
78881f8b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
Cython/Compiler/AutoDocTransforms.py
Cython/Compiler/AutoDocTransforms.py
+1
-1
tests/run/embedsignatures.pyx
tests/run/embedsignatures.pyx
+18
-0
No files found.
Cython/Compiler/AutoDocTransforms.py
View file @
05d0a375
...
...
@@ -21,7 +21,7 @@ class EmbedSignature(CythonTransform):
try
:
denv
=
self
.
denv
# XXX
ctval
=
arg
.
default
.
compile_time_value
(
self
.
denv
)
return
'%
s
'
%
ctval
return
'%
r
'
%
ctval
except
Exception
:
try
:
return
arg
.
default
.
name
# XXX
...
...
tests/run/embedsignatures.pyx
View file @
05d0a375
...
...
@@ -36,6 +36,9 @@ __doc__ = ur"""
Ext.l(self, a, b, c=1, *args, d=42, e=17, f, **kwds)
Existing string
>>> print (Ext.m.__doc__)
Ext.m(self, a='spam')
>>> print (Ext.get_int.__doc__)
Ext.get_int(self) -> int
...
...
@@ -64,6 +67,12 @@ __doc__ = ur"""
>>> with_doc_4.__doc__
'with_doc_4(int a, str b, list c) -> str\n\n Existing string\n '
>>> f_sd.__doc__
"f_sd(str s='spam')"
>>> cf_sd.__doc__
"cf_sd(str s='spam') -> str"
>>> types.__doc__
'types(Ext a, int b, unsigned short c, float d, e)'
...
...
@@ -164,6 +173,9 @@ cdef class Ext:
"""Existing string"""
pass
def
m
(
self
,
a
=
'spam'
):
pass
cpdef
int
get_int
(
self
):
return
0
...
...
@@ -203,6 +215,12 @@ cpdef str with_doc_4(int a, str b, list c):
"""
return
b
def
f_sd
(
str
s
=
'spam'
):
return
s
cpdef
str
cf_sd
(
str
s
=
'spam'
):
return
s
cpdef
char
f_c
(
char
c
):
return
c
...
...
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