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

Make structseq more like collections.namedtuple #46561

Closed
gvanrossum opened this issue Mar 16, 2008 · 2 comments
Closed

Make structseq more like collections.namedtuple #46561

gvanrossum opened this issue Mar 16, 2008 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@gvanrossum
Copy link
Member

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

    @gvanrossum
    Copy link
    Member Author

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

    @gvanrossum gvanrossum added interpreter-core (Objects, Python, Grammar, and Parser dirs) stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Mar 16, 2008
    @devdanzin
    Copy link
    Mannequin

    devdanzin mannequin commented Feb 11, 2009

    Closing as a duplicate of bpo-1820.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant