New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__getslice__ still called #46317
Comments
The python documentation states that since python 2.0 __getslice__ is class Tuple(tuple):
def __getitem__(self, i): print '__getitem__', i
def __getslice__(self, i): print '__getslice__', i
t = Tuple()
t[0] # __getitem__ called with type(i) == int
t[0:2] # __getslice__ called with type(i) == slice
t[0:2:1] # __getitem__ called with type(i) == slice |
I think the docs do a good job of explaining this; in particular, they "However, built-in types in CPython currently still implement and explain that __getslice__ is used only to implement the form a[i:j], Getting rid of __getslice__ for builtin types in Python 2.x is probably I'd recommend closing this as invalid, but I'll wait for a second |
Mark, thanks for the quick follow-up. Yes, I believe this issue can be closed as invalid. Thanks, --
|
Well, documentation patches are always welcome, I believe :) If you can point to a particular place in the documentation and suggest |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: