We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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?
to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
assignee = None
closed_at = <Date 2018-08-11.06:05:27.273>
created_at = <Date 2010-07-24.13:04:52.646>
labels = ['expert-XML', '3.8', 'type-bug', 'library']
title = 'pulldom.DOMEventStream.__getitem__ is broken'
updated_at = <Date 2018-08-11.06:05:27.272>
user = 'https://bugs.python.org/marksmith'
activity = <Date 2018-08-11.06:05:27.272>
actor = 'berker.peksag'
assignee = 'none'
closed = True
closed_date = <Date 2018-08-11.06:05:27.273>
closer = 'berker.peksag'
components = ['Library (Lib)', 'XML']
creation = <Date 2010-07-24.13:04:52.646>
creator = 'mark.smith'
dependencies = 
files = ['29506']
hgrepos = 
issue_num = 9372
keywords = ['patch']
message_count = 8.0
messages = ['111475', '111477', '111479', '184773', '258342', '258363', '322879', '323400']
nosy_count = 6.0
nosy_names = ['eric.araujo', 'mark.smith', 'berker.peksag', 'martin.panter', 'serhiy.storchaka', 'Thomas Fenzl']
pr_nums = ['8609']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue9372'
versions = ['Python 3.8']
The text was updated successfully, but these errors were encountered:
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.
Sorry, something went wrong.
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__.
Also added a testcase checking for it. As item access to DOMEventStream was never documented, no changes were made to the documentation.
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.
New changeset 84a13fb by Berker Peksag in branch 'master':
bpo-9372: Deprecate several __getitem__ methods (GH-8609)
No branches or pull requests