Last active
December 16, 2016 20:17
-
-
Save Boldewyn/395bcdb1bc4b06e30d539405710dfa71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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