-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
pulldom.DOMEventStream.__getitem__ is broken #53618
Comments
DOMEventStream implements __getitem__, but ignores the index/key that is passed in and simply returns the next item from the stream. This is seriously unexpected behaviour. I don't believe this functionality can be sensibly implemented in this class, and plan to submit a patch deprecating this method. |
You may want to keep existing functionality, this time in the proper method (iter). |
I should have mentioned: __iter__ is already implemented, and works as expected. |
I added a depreciation warning to __getitem__. |
Left a review |
Similar outdated __getitem__ left in wsgiref.util.FileWrapper and fileinput.FileInput. |
I've fixed a bug that uses DOMEventStream.__getitem__ at work today. I've opened PR 8609 to deprecate __getitem__ methods of DOMEventStream, FileInput and FileWrapper classes. |
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: