[Python-ideas] Proposal to add new built-in struct (was: Add kwargs to built-in function object)

Terry Reedy tjreedy at udel.edu
Mon Jun 2 05:59:47 CEST 2008

"Greg Ewing" <greg.ewing at canterbury.ac.nz> wrote in 
message news:4835FBA4.8020206 at canterbury.ac.nz...
| Brandon Mintern wrote:
| > This is a proposal to add a new built-in named struct:
| >
| > struct(**kwargs)
| >     Return a struct object which has the attributes given in kwargs.
| I think I'd prefer 'record', to avoid any potential
| confusion with the struct module, which does something
| quite different.

I agree, perhaps even Record .., but in any case in the collections module.
Something like this has been the subject of enough c.l.p posts to make a 
case for something in the stdlib, but not in builtins.  An implementation 
in Python also serves as a model for variations.

More information about the Python-ideas mailing list