File: cdef_func_decorators.pyx

package info (click to toggle)
cython 3.0.11%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 19,092 kB
  • sloc: python: 83,539; ansic: 18,831; cpp: 1,402; xml: 1,031; javascript: 511; makefile: 403; sh: 204; sed: 11
file content (39 lines) | stat: -rw-r--r-- 813 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# mode: error
# tag: decorator

from functools import wraps

@wraps
cdef cant_be_decoratored():
    pass

@wraps
cpdef also_cant_be_decorated():
    pass

cdef class C:
    @wraps
    cdef still_cant_be_decorated(self):
        pass

    @property
    cdef property_only_works_for_extern_classes(self):
        pass

    @wraps
    cpdef also_still_cant_be_decorated(self):
        pass

    @wraps
    @wraps
    cdef two_is_just_as_bad_as_one(self):
        pass

_ERRORS = """
6:0: Cdef functions cannot take arbitrary decorators.
10:0: Cdef functions cannot take arbitrary decorators.
15:4: Cdef functions cannot take arbitrary decorators.
19:4: Cdef functions cannot take arbitrary decorators.
23:4: Cdef functions cannot take arbitrary decorators.
27:4: Cdef functions cannot take arbitrary decorators.
"""