[Python-Dev] Proposal: add odict to collections

Armin Ronacher armin.ronacher at active-4.com
Sun Jun 15 11:39:05 CEST 2008


Steven D'Aprano <steve <at> pearwood.info> writes:

> Conceptually, I would expect the following behaviour:
> 
> >>> od = odict()
> >>> od[1] = 'spam'  # insert a new key
> >>> od[2] = 'parrot'  # insert a new key
> >>> od[1] = 'ham'  # modify existing key
> >>> od.items()
> [(1, 'ham'), (2, 'parrot')]
That behavior is different to any ordered-dict implementation
out there ;-)

Regards,
Armin



More information about the Python-Dev mailing list