Antoon Pardon wrote:

> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "vslice.py", line 48, in ?
>     class iterslice(slice):
> TypeError: Error when calling the metaclass bases
>     type 'slice' is not an acceptable base type

Searching for "not an acceptable base type" in the Python source reveals 
that this exception is produced when the proposed base type doesn't have 
Py_TPFLAGS_BASETYPE set.

> So what is going on. I thought the class vs type
> distinction was eliminated in order to be able
> to subclass base types. So why doesn't this work?

slice.__base__ == object. It's the basetype flag issue. You could 
propose a patch to make it subclassable.
-- 
Michael Hoffman
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to