[Python-3000] Ordered mapping type for Python 3000?

BJörn Lindqvist bjourne at gmail.com
Tue Mar 27 23:44:08 CEST 2007


On 3/27/07, Frank Benkstein <frank-python at benkstein.net> wrote:
> Hi,
>
> One thing that has come up quite often IIRC is the request for an
> ordered mapping type. It would like to propose to add such a type to
> Python 3000 and make it immutable, to prevent all kind of problems that
> would occur otherwise. Other than that it should behave just
> the same as dictionaries for all non-modifying operations.

Fantastic idea. If **kwargs where ordered it would finally be possible
to create a good (non-hackish!) attribute tuple:

col = attrtuple(r = 255, g = 0, b = 128)
r, g, b = col

Or define XML elements nicely:

el = make_el('input', type = 'text', class = 'query')

Or interface easier with tabular, order-dependent data.


-- 
mvh Björn


More information about the Python-3000 mailing list