Skip to content

Instantly share code, notes, and snippets.

@Boldewyn
Last active December 16, 2016 20:17
Show Gist options
  • Save Boldewyn/395bcdb1bc4b06e30d539405710dfa71 to your computer and use it in GitHub Desktop.
Save Boldewyn/395bcdb1bc4b06e30d539405710dfa71 to your computer and use it in GitHub Desktop.
>>> class X:
... def __getitem__(self, item):
... print isinstance(item, slice)
... print item
...
>>> y=X()
>>> y[1:3,5]
False
(slice(1, 3, None), 5)
>>> y[{'foo':'bar'}]
False
{'foo': 'bar'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment