File: cmethbasematch.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 (45 lines) | stat: -rw-r--r-- 1,113 bytes parent folder | download | duplicates (5)
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
40
41
42
43
44
45
# mode: error

cdef class C:
    cdef void f(self):
        pass

cdef class D(C):
    cdef void f(self, int x):
        pass

# These are declared in the pxd.
cdef class Base(object):
  cdef f(self):
    pass

cdef class MissingRedeclaration(Base):
  # Not declared (so assumed cdef) in the pxd.
  cpdef f(self):
    pass

cdef class BadRedeclaration(Base):
  # Declared as cdef in the pxd.
  cpdef f(self):
    pass

cdef class UnneededRedeclaration(Base):
  # This is OK, as it's not declared in the pxd.
  cpdef f(self):
    pass

cdef class NarrowerReturn(Base):
  # This does not require a new vtable entry.
  cdef Base f(self):
    pass


_ERRORS = u"""
8: 9: Signature not compatible with previous declaration
4: 9: Previous declaration is here
# TODO(robertwb): Re-enable these errors.
#18:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type 'MissingRedeclaration'
#2:9: Previous declaration is here
#23:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type 'BadRedeclaration'
#2:9: Previous declaration is here
"""