~ubuntu-branches/ubuntu/precise/cython/precise

« back to all changes in this revision

Viewing changes to tests/run/always_allow_keywords_T295.pyx

  • Committer: Bazaar Package Importer
  • Author(s): Python Applications Packaging Team, Ryan Kavanagh, Jakub Wilk, Piotr Ożarowski
  • Date: 2009-08-10 23:18:51 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090810231851-i6f7mr1ij1h2czkp
Tags: 0.11.2-1
[ Ryan Kavanagh ]
* New upstream release (Closes: #525620, #536213)

[ Jakub Wilk ]
* debian/rules: remove generated files.

[ Piotr Ożarowski ]
* Standards-Version bumped to 3.8.2 (no change needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
__doc__ = """
 
2
>>> func1(None)
 
3
>>> func1(*[None])
 
4
>>> func1(arg=None)
 
5
Traceback (most recent call last):
 
6
...
 
7
TypeError: func1() takes no keyword arguments
 
8
>>> func2(None)
 
9
>>> func2(*[None])
 
10
>>> func2(arg=None)
 
11
Traceback (most recent call last):
 
12
...
 
13
TypeError: func2() takes no keyword arguments
 
14
>>> func3(None)
 
15
>>> func3(*[None])
 
16
>>> func3(arg=None)
 
17
 
 
18
>>> A().meth1(None)
 
19
>>> A().meth1(*[None])
 
20
>>> A().meth1(arg=None)
 
21
Traceback (most recent call last):
 
22
...
 
23
TypeError: meth1() takes no keyword arguments
 
24
>>> A().meth2(None)
 
25
>>> A().meth2(*[None])
 
26
>>> A().meth2(arg=None)
 
27
Traceback (most recent call last):
 
28
...
 
29
TypeError: meth2() takes no keyword arguments
 
30
>>> A().meth3(None)
 
31
>>> A().meth3(*[None])
 
32
>>> A().meth3(arg=None)
 
33
"""
 
34
 
 
35
cimport cython
 
36
 
 
37
 
 
38
def func1(arg):
 
39
    pass
 
40
 
 
41
@cython.always_allow_keywords(False)
 
42
def func2(arg):
 
43
    pass
 
44
 
 
45
@cython.always_allow_keywords(True)
 
46
def func3(arg):
 
47
    pass
 
48
 
 
49
cdef class A:
 
50
 
 
51
    def meth1(self, arg):
 
52
        pass
 
53
 
 
54
    @cython.always_allow_keywords(False)
 
55
    def meth2(self, arg):
 
56
        pass
 
57
 
 
58
    @cython.always_allow_keywords(True)
 
59
    def meth3(self, arg):
 
60
        pass