test for ticket #608
[cython.git] / tests / run / builtin_type_inheritance_T608.pyx
1
2 cdef class MyInt(int):
3     """
4     >>> MyInt(2) == 2
5     True
6     >>> MyInt(2).attr is None
7     True
8     """
9     cdef readonly object attr
10
11 cdef class MyFloat(float):
12     """
13     >>> MyFloat(1.0)== 1.0
14     True
15     >>> MyFloat(1.0).attr is None
16     True
17     """
18     cdef readonly object attr
19
20 ustring = u'abc'
21
22 cdef class MyUnicode(unicode):
23     """
24     >>> MyUnicode(ustring) == ustring
25     True
26     >>> MyUnicode(ustring).attr is None
27     True
28     """
29     cdef readonly object attr
30
31 cdef class MyList(list):
32     """
33     >>> MyList([1,2,3]) == [1,2,3]
34     True
35     >>> MyList([1,2,3]).attr is None
36     True
37     """
38     cdef readonly object attr
39
40 cdef class MyDict(dict):
41     """
42     >>> MyDict({1:2, 3:4}) == {1:2, 3:4}
43     True
44     >>> MyDict({1:2, 3:4}).attr is None
45     True
46     """
47     cdef readonly object attr