def __getitem__(self, spec):
        """Get a contained item or slice of contained items.

        Fetching a slice returns a new instance of this class containing the
        subset of items defined by the slice.
        """
        if isinstance(spec, slice):
            self = copy(self)
            self._items = self._items[spec]
            return self
        else:
            return self._items[spec]
def __getitem__ ( self , spec ) : if isinstance ( spec , slice ) : self = copy ( self ) self . _items = self . _items [ spec ] return self else : return self . _items [ spec ]
Get a contained item or slice of contained items.

        Fetching a slice returns a new instance of this class containing the
        subset of items defined by the slice.