[New-bugs-announce] [issue2308] Make structseq more like collections.namedtuple

Guido van Rossum report at bugs.python.org
Sun Mar 16 22:19:31 CET 2008


New submission from Guido van Rossum <guido at python.org>:

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

----------
components: Interpreter Core, Library (Lib)
messages: 63594
nosy: gvanrossum
priority: high
severity: normal
status: open
title: Make structseq more like collections.namedtuple
type: behavior
versions: Python 2.6, Python 3.0

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2308>
__________________________________


More information about the New-bugs-announce mailing list