[IronPython] Dictionary Ordering (original) (raw)

Dino Viehland dinov at exchange.microsoft.com
Wed May 17 17:14:57 CEST 2006


It's an implementation detail which may change in future versions.

There's a OrderedDict in the Python cookbook though that should work w/ IP.

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/438823

Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)

-----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, May 17, 2006 6:36 AM To: Discussion of IronPython Subject: [IronPython] Dictionary Ordering

Hello all,

IronPython seems to default to have a dictionary 'ordering' based on key insertion order.

This is nice, but differs from the CPython implementation. However the spec (as I'm sure you're aware) says : (from http://docs.python.org/lib/typesmapping.html )

 Keys and values are listed in an arbitrary order which is

non-random, varies across Python implementations, and depends on the dictionary's history of insertions and deletions.

So IronPython behaviour is well within the spec. My question is, can we rely on the ordered behaviour of IronPython ? (Or is it an implementation detail that may change in future versions ?)

Michael Foord http://www.resolversystems.com


users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list