Skip to content

Instantly share code, notes, and snippets.

@Boldewyn
Last active Dec 16, 2016
Embed
What would you like to do?
>>> 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