On Sun, Jul 1, 2012 at 10:56 PM, Chris Smith <[email protected]> wrote:
>>> a) Yes, use native dicts as much as possible. Trying to improve over a core
>>> data structure that's getting unlimited love from the language team doesn't
>>> sound like a winning idea to me :-)
>>
>> Yes, this is the main point in Python.
>>
>>> b) Keep the sorted list of keys in a separate member variable.
>
> Are you aware that there is now an ordered dictionary in python? It
> was backported to 2.7.3, I believe.

This looks fine, but do you some data as to the speed?  [0] says that
it keeps the items in the order in which they were inserted.  That
smells of sequential storage and thus doesn't sound terribly cool
performance-wise, when random-access is needed.

Nevertheless, it's good to know that Python has such a feature, thank
you.

Sergiu

[0] http://docs.python.org/dev/whatsnew/2.7.html#pep-0372

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to