type 'slice' is not an acceptable base type

Antoon Pardon apardon at forel.vub.ac.be
Tue Dec 20 11:44:15 CET 2005


That was the message I received when I imported a self
written module. All I wanted to do was experiment with
subclassing slice. So I write something like:

class iterslice(slice):
  ...


And when I fired up the python interpreter

>>> from vslice import *
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


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?

-- 
Antoon Pardon



More information about the Python-list mailing list