def __getitem__(self, key):
        """Overwrites lists __getitem__ by returning an ArrayList if `key` is a
        slice"""
        if isinstance(key, slice):  # return a new ArrayList
            return self.__class__(
                super(ArrayList, self).__getitem__(key))
        else:  # return the item
            return super(ArrayList, self).__getitem__(key)
def __getitem__ ( self , key ) : if isinstance ( key , slice ) : return self . __class__ ( super ( ArrayList , self ) . __getitem__ ( key ) ) else : return super ( ArrayList , self ) . __getitem__ ( key )
Overwrites lists __getitem__ by returning an ArrayList if `key` is a
        slice