Skip to content

Make structseq more like collections.namedtuple #46561

Closed

Description

@gvanrossum
BPO 2308
Nosy @gvanrossum, @rhettinger, @devdanzin
Superseder
  • bpo-1820: Enhance Object/structseq.c to match namedtuple and tuple api
  • 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 2009-02-11.04:39:11.914>
    created_at = <Date 2008-03-16.21:19:30.784>
    labels = ['interpreter-core', 'type-bug', 'library']
    title = 'Make structseq more like collections.namedtuple'
    updated_at = <Date 2009-02-11.04:39:11.892>
    user = 'https://github.com/gvanrossum'

    bugs.python.org fields:

    activity = <Date 2009-02-11.04:39:11.892>
    actor = 'ajaksu2'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-02-11.04:39:11.914>
    closer = 'ajaksu2'
    components = ['Interpreter Core', 'Library (Lib)']
    creation = <Date 2008-03-16.21:19:30.784>
    creator = 'gvanrossum'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 2308
    keywords = []
    message_count = 2.0
    messages = ['63594', '81626']
    nosy_count = 3.0
    nosy_names = ['gvanrossum', 'rhettinger', 'ajaksu2']
    pr_nums = []
    priority = 'high'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '1820'
    type = 'behavior'
    url = 'https://bugs.python.org/issue2308'
    versions = ['Python 2.6', 'Python 3.0']

    Activity

    1. gvanrossum commented on Mar 16, 2008

      @gvanrossum
      MemberAuthor

      The built-in type structseq (used by e.g. os.stat() for the stat
      structure and by the time module for a time tuple) resembles the new
      namedtuple type added to the collections module in 2.6.

      It would be nice if these had at least a common ABC if not a shared
      implementation.

      At the same time I think that in 3.0 we should remove the feature of
      "hidden fields" which is used to have structs that behave like
      fixed-size tuples even though they have a variable number of named
      fields (the list of names varies per platform). We should deprecate the
      use of tuple-unpacking for these (except for the first 6 fields of a
      timetuple, perhaps).

    2. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Mar 16, 2008
    3. devdanzin commented on Feb 11, 2009

      devdanzinmannequin
      Mannequin

      Closing as a duplicate of bpo-1820.

    4. 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

      interpreter-core(Objects, Python, Grammar, and Parser dirs)stdlibStandard 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