You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pulldom.DOMEventStream.__getitem__ is broken #53618
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.
I should have mentioned: __iter__ is already implemented, and works as expected.
ThomasFenzl commented on Mar 20, 2013
ThomasFenzlmannequin
Mannequin
More actions
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.
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.
Activity
marksmith commentedon Jul 24, 2010
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.
merwok commentedon Jul 24, 2010
You may want to keep existing functionality, this time in the proper method (iter).
marksmith commentedon Jul 24, 2010
I should have mentioned: __iter__ is already implemented, and works as expected.
ThomasFenzl commentedon Mar 20, 2013
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.
vadmium commentedon Jan 16, 2016
Left a review
serhiy-storchaka commentedon Jan 16, 2016
Similar outdated __getitem__ left in wsgiref.util.FileWrapper and fileinput.FileInput.
berkerpeksag commentedon Aug 1, 2018
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.
berkerpeksag commentedon Aug 11, 2018
New changeset 84a13fb by Berker Peksag in branch 'master':
bpo-9372: Deprecate several __getitem__ methods (GH-8609)
84a13fb