def __getitem__(self, key):
if isinstance(key, slice):<EOL><INDENT>stop = key.stop<EOL>if stop is None:<EOL><INDENT>stop = len(self)<EOL><DEDENT>elif isinstance(stop, int) and stop < <NUM_LIT:0>:<EOL><INDENT>stop = len(self) + stop<EOL><DEDENT>return ItemList(self, offset=key.start, stop=stop, cached=self.is_cached)<EOL><DEDENT>if type(key) is not int:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>item = ItemList(self, limit=<NUM_LIT:1>, offset=key, stop=key + <NUM_LIT:1>, cached=self.is_cached)<EOL>return item[key]<EOL>
``key`` should either be an integer or a ``slice`` object. If a ``slice``
object is passed in with a step parameter, the stepping will be silently
ignored. For example::

    >>> inbox = pump.me.inbox[slice(0, 10, 2)]
    >>> print(len(inbox))
    10  # step been ignored