Skip to content

pulldom.DOMEventStream.__getitem__ is broken #53618

Closed

Description

@marksmith
mannequin
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']

    Activity

    1. marksmith commented on Jul 24, 2010

      marksmithmannequin
      MannequinAuthor

      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.

    2. merwok commented on Jul 24, 2010

      @merwok
      Member

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

    3. added
      type-bug
      on Jul 24, 2010
    4. marksmith commented on Jul 24, 2010

      marksmithmannequin
      MannequinAuthor

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

    5. ThomasFenzl commented on Mar 20, 2013

      ThomasFenzlmannequin
      Mannequin

      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.

    6. vadmium commented on Jan 16, 2016

      @vadmium
      Member

      Left a review

    7. serhiy-storchaka commented on Jan 16, 2016

      @serhiy-storchaka
      Member

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

    8. berkerpeksag commented on Aug 1, 2018

      @berkerpeksag
      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.

    9. added
      stdlib
      3.8 (EOL)
      on Aug 1, 2018
    10. berkerpeksag commented on Aug 11, 2018

      @berkerpeksag
      Member

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

    11. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)stdlibtopic-XMLtype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions