base_class_entry.type.scope.directives['final']:
error(self.pos, "Base class '%s' of type '%s' is final" % (
self.base_class_name, self.class_name))
+ elif base_class_entry.type.is_builtin_type and \
+ base_class_entry.type.name in ('tuple', 'str', 'bytes'):
+ error(self.pos, "inheritance from PyVarObject types like '%s' is not currently supported"
+ % base_class_entry.type.name)
else:
self.base_type = base_class_entry.type
has_body = self.body is not None
--- /dev/null
+
+# current restriction: cannot inherit from PyVarObject (see ticket #152)
+
+cdef class MyTuple(tuple):
+ pass
+
+cdef class MyBytes(bytes):
+ pass
+
+cdef class MyStr(str): # only in Py2, but can't know that during compilation
+ pass
+
+_ERRORS = """
+4:5: inheritance from PyVarObject types like 'tuple' is not currently supported
+7:5: inheritance from PyVarObject types like 'bytes' is not currently supported
+10:5: inheritance from PyVarObject types like 'str' is not currently supported
+"""