summaryrefslogtreecommitdiff
path: root/tests/run/exttype_gc.pyx
blob: db8ae2cc97da1e577aa9dc402a2e11d3d69494a1 (plain)
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
# mode: run
# tag: gc


def create_obj(cls):
    cls()  # create and discard


cdef class BaseTypeNoGC:
    pass


cdef class ExtTypeGC(BaseTypeNoGC):
    """
    >>> create_obj(ExtTypeGC)
    >>> create_obj(ExtTypeGC)
    >>> create_obj(ExtTypeGC)

    >>> class PyExtTypeGC(ExtTypeGC): pass
    >>> create_obj(PyExtTypeGC)
    >>> create_obj(PyExtTypeGC)
    >>> create_obj(PyExtTypeGC)
    """
    cdef object attr


cdef class ExtTypeNoGC(BaseTypeNoGC):
    """
    >>> create_obj(ExtTypeNoGC)
    >>> create_obj(ExtTypeNoGC)
    >>> create_obj(ExtTypeNoGC)

    >>> class PyExtTypeNoGC(ExtTypeNoGC): pass
    >>> create_obj(PyExtTypeNoGC)
    >>> create_obj(PyExtTypeNoGC)
    >>> create_obj(PyExtTypeNoGC)
    """
    cdef int x