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
f5dbcd6e
Commit
f5dbcd6e
authored
Jul 20, 2017
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: Add tests for embedsignature with function annotations
parent
40a3c5c1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
129 additions
and
0 deletions
+129
-0
tests/run/embedsignatures.pyx
tests/run/embedsignatures.pyx
+129
-0
No files found.
tests/run/embedsignatures.pyx
View file @
f5dbcd6e
...
...
@@ -394,3 +394,132 @@ cpdef (char*) f_charptr_null(char* s=NULL):
# no signatures for lambda functions
lambda_foo
=
lambda
x
:
10
lambda_bar
=
lambda
x
:
20
cdef
class
Foo
:
def
m00
(
self
,
a
:
None
)
->
None
:
pass
def
m01
(
self
,
a
:
...)
->
Ellipsis
:
pass
def
m02
(
self
,
a
:
True
,
b
:
False
)
->
bool
:
pass
def
m03
(
self
,
a
:
42
,
b
:
+
42
,
c
:
-
42
)
->
int
:
pass
# XXX +42 -> 42
def
m04
(
self
,
a
:
3.14
,
b
:
+
3.14
,
c
:
-
3.14
)
->
float
:
pass
def
m05
(
self
,
a
:
1
+
2j
,
b
:
+
2j
,
c
:
-
2j
)
->
complex
:
pass
def
m06
(
self
,
a
:
"abc"
,
b
:
b"abc"
,
c
:
u"abc"
)
->
(
str
,
bytes
,
unicode
)
:
pass
def
m07
(
self
,
a
:
[
1
,
2
,
3
],
b
:
[])
->
list
:
pass
def
m08
(
self
,
a
:
(
1
,
2
,
3
),
b
:
())
->
tuple
:
pass
def
m09
(
self
,
a
:
{
1
,
2
,
3
},
b
:
{
i
for
i
in
()})
->
set
:
pass
def
m10
(
self
,
a
:
{
1
:
1
,
2
:
2
,
3
:
3
},
b
:
{})
->
dict
:
pass
#def m11(self, a: [str(i) for i in range(3)]): pass # Issue 1782
def
m12
(
self
,
a
:
(
str
(
i
)
for
i
in
range
(
3
))):
pass
def
m13
(
self
,
a
:
(
str
(
i
)
for
i
in
range
(
3
)
if
bool
(
i
))):
pass
def
m14
(
self
,
a
:
{
str
(
i
)
for
i
in
range
(
3
)}):
pass
def
m15
(
self
,
a
:
{
str
(
i
)
for
i
in
range
(
3
)
if
bool
(
i
)}):
pass
def
m16
(
self
,
a
:
{
str
(
i
):
id
(
i
)
for
i
in
range
(
3
)}):
pass
def
m17
(
self
,
a
:
{
str
(
i
):
id
(
i
)
for
i
in
range
(
3
)
if
bool
(
i
)}):
pass
def
m18
(
self
,
a
:
dict
.
update
(
x
=
42
,
**
dict
(),
**
{})):
pass
def
m19
(
self
,
a
:
sys
is
None
,
b
:
sys
is
not
None
):
pass
def
m20
(
self
,
a
:
sys
in
[],
b
:
sys
not
in
[]):
pass
def
m21
(
self
,
a
:
(
sys
or
sys
)
and
sys
,
b
:
not
(
sys
or
sys
)):
pass
def
m22
(
self
,
a
:
42
if
sys
else
None
):
pass
def
m23
(
self
,
a
:
+
int
(),
b
:
-
int
(),
c
:
~
int
()):
pass
def
m24
(
self
,
a
:
(
1
+
int
(
2
))
*
3
+
(
4
*
int
(
5
))
**
(
1
+
0.0
/
1
)):
pass
def
m25
(
self
,
a
:
list
(
range
(
3
))[:]):
pass
def
m26
(
self
,
a
:
list
(
range
(
3
))[
1
:]):
pass
def
m27
(
self
,
a
:
list
(
range
(
3
))[:
1
]):
pass
def
m28
(
self
,
a
:
list
(
range
(
3
))[::
1
]):
pass
def
m29
(
self
,
a
:
list
(
range
(
3
))[
0
:
1
:
1
]):
pass
def
m30
(
self
,
a
:
list
(
range
(
3
))[
7
,
3
:
2
:
1
,
...]):
pass
__doc__
+=
ur"""
>>> print(Foo.m00.__doc__)
Foo.m00(self, a: None) -> None
>>> print(Foo.m01.__doc__)
Foo.m01(self, a: ...) -> Ellipsis
>>> print(Foo.m02.__doc__)
Foo.m02(self, a: True, b: False) -> bool
>>> print(Foo.m03.__doc__)
Foo.m03(self, a: 42, b: 42, c: -42) -> int
>>> print(Foo.m04.__doc__)
Foo.m04(self, a: 3.14, b: 3.14, c: -3.14) -> float
>>> print(Foo.m05.__doc__)
Foo.m05(self, a: 1 + 2j, b: +2j, c: -2j) -> complex
>>> print(Foo.m06.__doc__)
Foo.m06(self, a: 'abc', b: b'abc', c: u'abc') -> (str, bytes, unicode)
>>> print(Foo.m07.__doc__)
Foo.m07(self, a: [1, 2, 3], b: []) -> list
>>> print(Foo.m08.__doc__)
Foo.m08(self, a: (1, 2, 3), b: ()) -> tuple
>>> print(Foo.m09.__doc__)
Foo.m09(self, a: {1, 2, 3}, b: set()) -> set
>>> print(Foo.m10.__doc__)
Foo.m10(self, a: {1: 1, 2: 2, 3: 3}, b: {}) -> dict
# >>> print(Foo.m11.__doc__)
# Foo.m11(self, a: [str(i) for i in range(3)])
>>> print(Foo.m12.__doc__)
Foo.m12(self, a: (str(i) for i in range(3)))
>>> print(Foo.m13.__doc__)
Foo.m13(self, a: (str(i) for i in range(3) if bool(i)))
>>> print(Foo.m14.__doc__)
Foo.m14(self, a: {str(i) for i in range(3)})
>>> print(Foo.m15.__doc__)
Foo.m15(self, a: {str(i) for i in range(3) if bool(i)})
>>> print(Foo.m16.__doc__)
Foo.m16(self, a: {str(i): id(i) for i in range(3)})
>>> print(Foo.m17.__doc__)
Foo.m17(self, a: {str(i): id(i) for i in range(3) if bool(i)})
>>> print(Foo.m18.__doc__)
Foo.m18(self, a: dict.update(x=42, **dict()))
>>> print(Foo.m19.__doc__)
Foo.m19(self, a: sys is None, b: sys is not None)
>>> print(Foo.m20.__doc__)
Foo.m20(self, a: sys in [], b: sys not in [])
>>> print(Foo.m21.__doc__)
Foo.m21(self, a: (sys or sys) and sys, b: not (sys or sys))
>>> print(Foo.m22.__doc__)
Foo.m22(self, a: 42 if sys else None)
>>> print(Foo.m23.__doc__)
Foo.m23(self, a: +int(), b: -int(), c: ~int())
>>> print(Foo.m24.__doc__)
Foo.m24(self, a: (1 + int(2)) * 3 + (4 * int(5)) ** (1 + 0.0 / 1))
>>> print(Foo.m25.__doc__)
Foo.m25(self, a: list(range(3))[:])
>>> print(Foo.m26.__doc__)
Foo.m26(self, a: list(range(3))[1:])
>>> print(Foo.m27.__doc__)
Foo.m27(self, a: list(range(3))[:1])
>>> print(Foo.m28.__doc__)
Foo.m28(self, a: list(range(3))[::1])
>>> print(Foo.m29.__doc__)
Foo.m29(self, a: list(range(3))[0:1:1])
>>> print(Foo.m30.__doc__)
Foo.m30(self, a: list(range(3))[7, 3:2: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