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
7f265f55
Commit
7f265f55
authored
Jan 17, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
...
parents
490889d3
89c93887
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
8 deletions
+56
-8
tests/run/kwonlyargs.pyx
tests/run/kwonlyargs.pyx
+17
-8
tests/run/powop.pyx
tests/run/powop.pyx
+12
-0
tests/run/tuplereassign.pyx
tests/run/tuplereassign.pyx
+27
-0
No files found.
tests/run/kwonlyargs.pyx
View file @
7f265f55
__doc__
=
"""
>>> b(1,2,3)
>>> b(1,2,3,4)
Traceback (most recent call last):
TypeError: function takes exactly 3 arguments (4 given)
>>> c(1,2)
>>> c(1,2,3)
>>> c(1,2,3,4)
Traceback (most recent call last):
TypeError: function takes
exactly
3 arguments (4 given)
TypeError: function takes
at most
3 arguments (4 given)
>>> d(1,2)
>>> d(1,2, c=1)
...
...
@@ -63,20 +69,23 @@ __doc__ = """
TypeError: required keyword argument 'c' is missing
"""
def
c
(
a
,
b
,
c
):
z
=
33
def
b
(
a
,
b
,
c
):
pass
def
c
(
a
,
b
,
c
=
1
):
pass
def
d
(
a
,
b
,
*
,
c
=
88
):
z
=
44
pass
def
e
(
a
,
b
,
c
=
88
,
**
kwds
):
z
=
55
pass
def
f
(
a
,
b
,
*
,
c
,
d
=
42
):
z
=
66
pass
def
g
(
a
,
b
,
*
,
c
,
d
=
42
,
e
=
17
,
f
,
**
kwds
):
z
=
77
pass
def
h
(
a
,
b
,
*
args
,
c
,
d
=
42
,
e
=
17
,
f
,
**
kwds
):
z
=
88
pass
tests/run/powop.pyx
View file @
7f265f55
...
...
@@ -2,6 +2,12 @@ __doc__ = """
>>> f(1.0, 2.95)[0] == f(1.0, 2.95)[1]
True
>>> g(4)
1024
>>> h(4)
625
>>> constant_py() == 2L ** 10
True
...
...
@@ -17,6 +23,12 @@ def f(obj2, obj3):
obj1
=
obj2
**
obj3
return
flt1
,
obj1
def
g
(
i
):
return
i
**
5
def
h
(
i
):
return
5
**
i
def
constant_py
():
result
=
2L
**
10
return
result
...
...
tests/run/tuplereassign.pyx
0 → 100644
View file @
7f265f55
__doc__
=
"""
>>> test1( (1,2,3) )
1
>>> test3( (1,2,3) )
3
>>> test( (1,2,3) )
3
>>> testnonsense()
Traceback (most recent call last):
TypeError: 'int' object is not iterable
"""
def
test1
(
t
):
t
,
a
,
b
=
t
return
t
def
test3
(
t
):
a
,
b
,
t
=
t
return
t
def
test
(
t
):
t
,
t
,
t
=
t
return
t
def
testnonsense
():
t
,
t
,
t
=
1
*
2
return
t
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