Skip to content
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

Closed
marksmith mannequin opened this issue Jul 24, 2010 · 8 comments
Closed

pulldom.DOMEventStream.__getitem__ is broken #53618

marksmith mannequin opened this issue Jul 24, 2010 · 8 comments
Labels
3.8 only security fixes stdlib Python modules in the Lib dir topic-XML type-bug An unexpected behavior, bug, or error

Comments

@marksmith
Copy link
Mannequin

marksmith mannequin commented Jul 24, 2010

BPO 9372
Nosy @merwok, @berkerpeksag, @vadmium, @serhiy-storchaka
PRs
  • bpo-9372: Deprecate several __getitem__ methods #8609
  • Files
  • pulldom_deprecation.diff
  • 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:

    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'

    bugs.python.org fields:

    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']

    @marksmith
    Copy link
    Mannequin Author

    marksmith mannequin commented 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.

    @marksmith marksmith mannequin added the topic-XML label Jul 24, 2010
    @merwok
    Copy link
    Member

    merwok commented Jul 24, 2010

    You may want to keep existing functionality, this time in the proper method (iter).

    @merwok merwok added the type-bug An unexpected behavior, bug, or error label Jul 24, 2010
    @marksmith
    Copy link
    Mannequin Author

    marksmith mannequin commented Jul 24, 2010

    I should have mentioned: __iter__ is already implemented, and works as expected.

    @ThomasFenzl
    Copy link
    Mannequin

    ThomasFenzl mannequin commented 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
    Copy link
    Member

    vadmium commented Jan 16, 2016

    Left a review

    @serhiy-storchaka
    Copy link
    Member

    Similar outdated __getitem__ left in wsgiref.util.FileWrapper and fileinput.FileInput.

    @berkerpeksag
    Copy link
    Member

    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 berkerpeksag added stdlib Python modules in the Lib dir 3.8 only security fixes labels Aug 1, 2018
    @berkerpeksag
    Copy link
    Member

    New changeset 84a13fb by Berker Peksag in branch 'master':
    bpo-9372: Deprecate several __getitem__ methods (GH-8609)
    84a13fb

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes stdlib Python modules in the Lib dir topic-XML type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants