Skip to content

tuple function gives wrong answer when called on list subclass with custom __iter__ #67945

@DavidMacIver

Description

@DavidMacIver
BPO 23757
Nosy @rhettinger, @bitdancer, @serhiy-storchaka
Superseder
  • bpo-10977: Concrete object C API considered harmful to subclasses of builtin types
  • Files
  • listwithiter.py: Reproduction test case
  • fix_list_to_tuple.diff: Patch without the OP's test
  • fix_list_to_tuple_2.diff: + tests
  • 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 = 'https://github.com/rhettinger'
    closed_at = <Date 2015-05-17.21:47:59.965>
    created_at = <Date 2015-03-24.08:42:29.638>
    labels = ['easy', 'type-bug', 'library']
    title = 'tuple function gives wrong answer when called on list subclass with custom __iter__'
    updated_at = <Date 2015-05-17.21:47:59.964>
    user = 'https://bugs.python.org/DavidMacIver'

    bugs.python.org fields:

    activity = <Date 2015-05-17.21:47:59.964>
    actor = 'rhettinger'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2015-05-17.21:47:59.965>
    closer = 'rhettinger'
    components = ['Library (Lib)']
    creation = <Date 2015-03-24.08:42:29.638>
    creator = 'David MacIver'
    dependencies = []
    files = ['38663', '39365', '39404']
    hgrepos = []
    issue_num = 23757
    keywords = ['patch', 'easy']
    message_count = 11.0
    messages = ['239098', '239138', '239152', '239154', '239161', '243073', '243158', '243159', '243392', '243428', '243429']
    nosy_count = 6.0
    nosy_names = ['rhettinger', 'stub', 'r.david.murray', 'python-dev', 'serhiy.storchaka', 'David MacIver']
    pr_nums = []
    priority = 'high'
    resolution = 'fixed'
    stage = 'commit review'
    status = 'closed'
    superseder = '10977'
    type = 'behavior'
    url = 'https://bugs.python.org/issue23757'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    Metadata

    Metadata

    Assignees

    Labels

    easystdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions