To get the interval of a list object is handled inside the getitem built-in function. Since it only checks whether given parameter to this function is int or not, the slice objects enters the else statement which causes a problem. Possible Fix:
def __getitem__(self, expr):
if type(expr) is int or type(expr) is slice:
return list.__getitem__(self, expr)
else:
return Element(self, expr)
Thank you.
To get the interval of a list object is handled inside the getitem built-in function. Since it only checks whether given parameter to this function is int or not, the slice objects enters the else statement which causes a problem. Possible Fix:
Thank you.