6 >>> MyInt(2).attr is None
9 cdef readonly object attr
11 cdef class MyInt2(int):
15 >>> MyInt2(2).attr is None
20 cdef readonly object attr
23 return self._test(arg)
25 cdef _test(self, arg):
28 cdef class MyInt3(MyInt2):
32 >>> MyInt3(2).attr is None
37 cdef _test(self, arg):
40 cdef class MyFloat(float):
42 >>> MyFloat(1.0)== 1.0
44 >>> MyFloat(1.0).attr is None
47 cdef readonly object attr
51 cdef class MyUnicode(unicode):
53 >>> MyUnicode(ustring) == ustring
55 >>> MyUnicode(ustring + ustring) == ustring
57 >>> MyUnicode(ustring).attr is None
60 cdef readonly object attr
62 cdef class MyList(list):
64 >>> MyList([1,2,3]) == [1,2,3]
66 >>> MyList([1,2,3]).attr is None
69 cdef readonly object attr
71 cdef class MyListOverride(list):
73 >>> MyListOverride([1,2,3]) == [1,2,3]
75 >>> l = MyListOverride([1,2,3])
85 >>> l = MyListOverride([1,2,3])
99 ## FIXME: this doesn't currently work:
101 ## cdef int append(self, value) except -1:
102 ## self[:] = self + [0] + [value]
105 ## def _append(self, value):
106 ## self.append(value)
108 cdef class MyDict(dict):
110 >>> MyDict({1:2, 3:4}) == {1:2, 3:4}
112 >>> MyDict({1:2, 3:4}).attr is None
115 cdef readonly object attr