[python-uk] memoize & ordering of kwargs.items()

Matt Hamilton matth at netsight.co.uk
Fri Nov 11 14:02:18 CET 2011


On 11 Nov 2011, at 12:54, Alexander Harrowell wrote:

> This is surely inherent in the fact that python dictionaries are not deterministically ordered. The dox don't say that you will always get key-val pairs back in *different* orders - just that you cannot rely on them being in the *same* order. Equally, you can't assume that they *won't*.

In CPython they *are* deterministically ordered though through their implementation. The API just states that for the purposes of the API you cannot rely on the order of the keys/values returned as that is a side effect of the implementation.

-Matt

> NETSIGHT
> 
> Matt Hamilton
> Technical Director
> Email
> matth at netsight.co.uk
> 
> Telephone
> +44 (0) 117 909 0901
> 
> 
> Web
> www.netsight.co.uk
> 
> Address
> 40 Berkeley Square, Clifton 
> Bristol BS8 1HU







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-uk/attachments/20111111/284a4b98/attachment-0001.html>


More information about the python-uk mailing list