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

Georg Brandl g.brandl at gmx.net
Fri May 23 11:49:45 CEST 2008


Greg Ewing schrieb:
> 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.
> 
> Also, my Pascal background makes the term 'record'
> seem more high-level and therefore Pythonic to me.

In the past, people have also suggested 'namespace' for the same
concept.

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.




More information about the Python-ideas mailing list