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
7c762d67
Commit
7c762d67
authored
Nov 29, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix embedsignatures test in Py3.4
parent
4f0f4ca7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
34 deletions
+52
-34
tests/run/embedsignatures.pyx
tests/run/embedsignatures.pyx
+52
-34
No files found.
tests/run/embedsignatures.pyx
View file @
7c762d67
#cython: embedsignature=True
#cython: embedsignature=True
import
sys
if
sys
.
version_info
>=
(
3
,
4
):
def
funcdoc
(
f
):
doc
=
'%s%s'
%
(
f
.
__name__
,
f
.
__text_signature__
)
if
f
.
__doc__
:
if
'
\
n
'
in
f
.
__doc__
:
# preceding line endings get stripped
doc
=
'%s
\
n
\
n
%s'
%
(
doc
,
f
.
__doc__
)
else
:
doc
=
'%s
\
n
%s'
%
(
doc
,
f
.
__doc__
)
return
doc
else
:
def
funcdoc
(
f
):
return
f
.
__doc__
# note the r, we use \n below
# note the r, we use \n below
__doc__
=
ur"""
__doc__
=
ur"""
>>> print (Ext.__doc__)
>>> print (Ext.__doc__)
...
@@ -73,111 +91,111 @@ __doc__ = ur"""
...
@@ -73,111 +91,111 @@ __doc__ = ur"""
>>> print (Ext.clone.__doc__)
>>> print (Ext.clone.__doc__)
Ext.clone(self) -> Ext
Ext.clone(self) -> Ext
>>> print (f
oo.__doc__
)
>>> print (f
uncdoc(foo)
)
foo()
foo()
>>>
with_doc_1.__doc__
>>>
funcdoc(with_doc_1)
'with_doc_1(a, b, c)\nExisting string'
'with_doc_1(a, b, c)\nExisting string'
>>>
with_doc_2.__doc__
>>>
funcdoc(with_doc_2)
'with_doc_2(a, b, c)\n\n Existing string\n '
'with_doc_2(a, b, c)\n\n Existing string\n '
>>>
with_doc_3.__doc__
>>>
funcdoc(with_doc_3)
'with_doc_3(a, b, c)\nExisting string'
'with_doc_3(a, b, c)\nExisting string'
>>>
with_doc_4.__doc__
>>>
funcdoc(with_doc_4)
'with_doc_4(int a, str b, list c) -> str\n\n Existing string\n '
'with_doc_4(int a, str b, list c) -> str\n\n Existing string\n '
>>> f
_sd.__doc__
>>> f
uncdoc(f_sd)
"f_sd(str s='spam')"
"f_sd(str s='spam')"
>>>
cf_sd.__doc__
>>>
funcdoc(cf_sd)
"cf_sd(str s='spam') -> str"
"cf_sd(str s='spam') -> str"
>>>
types.__doc__
>>>
funcdoc(types)
'types(Ext a, int b, unsigned short c, float d, e)'
'types(Ext a, int b, unsigned short c, float d, e)'
>>> print
(f_c.__doc__
)
>>> print
(funcdoc(f_c)
)
f_c(char c) -> char
f_c(char c) -> char
>>> print
(f_uc.__doc__
)
>>> print
(funcdoc(f_uc)
)
f_uc(unsigned char c) -> unsigned char
f_uc(unsigned char c) -> unsigned char
>>> print
(f_sc.__doc__
)
>>> print
(funcdoc(f_sc)
)
f_sc(signed char c) -> signed char
f_sc(signed char c) -> signed char
>>> print
(f_s.__doc__
)
>>> print
(funcdoc(f_s)
)
f_s(short s) -> short
f_s(short s) -> short
>>> print
(f_us.__doc__
)
>>> print
(funcdoc(f_us)
)
f_us(unsigned short s) -> unsigned short
f_us(unsigned short s) -> unsigned short
>>> print
(f_ss.__doc__
)
>>> print
(funcdoc(f_ss)
)
f_ss(signed short s) -> signed short
f_ss(signed short s) -> signed short
>>> print
(f_i.__doc__
)
>>> print
(funcdoc(f_i)
)
f_i(int i) -> int
f_i(int i) -> int
>>> print
(f_ui.__doc__
)
>>> print
(funcdoc(f_ui)
)
f_ui(unsigned int i) -> unsigned int
f_ui(unsigned int i) -> unsigned int
>>> print
(f_si.__doc__
)
>>> print
(funcdoc(f_si)
)
f_si(signed int i) -> signed int
f_si(signed int i) -> signed int
>>> print
(f_bint.__doc__
)
>>> print
(funcdoc(f_bint)
)
f_bint(bool i) -> bool
f_bint(bool i) -> bool
>>> print
(f_l.__doc__
)
>>> print
(funcdoc(f_l)
)
f_l(long l) -> long
f_l(long l) -> long
>>> print
(f_ul.__doc__
)
>>> print
(funcdoc(f_ul)
)
f_ul(unsigned long l) -> unsigned long
f_ul(unsigned long l) -> unsigned long
>>> print
(f_sl.__doc__
)
>>> print
(funcdoc(f_sl)
)
f_sl(signed long l) -> signed long
f_sl(signed long l) -> signed long
>>> print
(f_L.__doc__
)
>>> print
(funcdoc(f_L)
)
f_L(long long L) -> long long
f_L(long long L) -> long long
>>> print
(f_uL.__doc__
)
>>> print
(funcdoc(f_uL)
)
f_uL(unsigned long long L) -> unsigned long long
f_uL(unsigned long long L) -> unsigned long long
>>> print
(f_sL.__doc__
)
>>> print
(funcdoc(f_sL)
)
f_sL(signed long long L) -> signed long long
f_sL(signed long long L) -> signed long long
>>> print
(f_f.__doc__
)
>>> print
(funcdoc(f_f)
)
f_f(float f) -> float
f_f(float f) -> float
>>> print
(f_d.__doc__
)
>>> print
(funcdoc(f_d)
)
f_d(double d) -> double
f_d(double d) -> double
>>> print
(f_D.__doc__
)
>>> print
(funcdoc(f_D)
)
f_D(long double D) -> long double
f_D(long double D) -> long double
>>> print
(f_my_i.__doc__
)
>>> print
(funcdoc(f_my_i)
)
f_my_i(MyInt i) -> MyInt
f_my_i(MyInt i) -> MyInt
>>> print
(f_my_f.__doc__
)
>>> print
(funcdoc(f_my_f)
)
f_my_f(MyFloat f) -> MyFloat
f_my_f(MyFloat f) -> MyFloat
>>> print
(f_defexpr1.__doc__
)
>>> print
(funcdoc(f_defexpr1)
)
f_defexpr1(int x=FLAG1, int y=FLAG2)
f_defexpr1(int x=FLAG1, int y=FLAG2)
>>> print
(f_defexpr2.__doc__
)
>>> print
(funcdoc(f_defexpr2)
)
f_defexpr2(int x=FLAG1 | FLAG2, y=FLAG1 & FLAG2)
f_defexpr2(int x=FLAG1 | FLAG2, y=FLAG1 & FLAG2)
>>> print
(f_defexpr3.__doc__
)
>>> print
(funcdoc(f_defexpr3)
)
f_defexpr3(int x=Ext.CONST1, f=__builtins__.abs)
f_defexpr3(int x=Ext.CONST1, f=__builtins__.abs)
>>> print
(f_defexpr4.__doc__
)
>>> print
(funcdoc(f_defexpr4)
)
f_defexpr4(int x=(Ext.CONST1 + FLAG1) * Ext.CONST2)
f_defexpr4(int x=(Ext.CONST1 + FLAG1) * Ext.CONST2)
>>> print
(f_defexpr5.__doc__
)
>>> print
(funcdoc(f_defexpr5)
)
f_defexpr5(int x=4)
f_defexpr5(int x=4)
"""
"""
...
...
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