I was trying to inherit xrange
(to implement membership testing with in
, as well as iteration). But I got the following error message:
TypeError: Error when calling the metaclass bases
type 'xrange' is not an acceptable base type
What's special about xrange
?
bool
,slice
orbuffer
. – Partridgeberryrange
type in Python 3.x already implements the behaviours that OP wanted - but is still not inheritable, so the question is not really version-specific. – Badman