[Python-3000] Ordered mapping type for Python 3000? (original) (raw)
BJörn Lindqvist bjourne at gmail.com
Tue Mar 27 23:44:08 CEST 2007
- Previous message: [Python-3000] Ordered mapping type for Python 3000?
- Next message: [Python-3000] Ordered mapping type for Python 3000?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-3000] Ordered mapping type for Python 3000?
- Next message: [Python-3000] Ordered mapping type for Python 3000?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]