-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multidicts does not preserve order on update #68
Comments
I don't think so. Thus the behavior is totally correct. |
I disagree. Updating for key Please also compare multidict ordering with: Now multidict behavior is last update preserving order not insertion preserving order and if you decide to leave this behavior, this difference should be clearly stated documentation. Now it is confusing for user familiar with |
Th problem is that What order should be after I guess Update first occurrence and delete all others? I have no intuitive clean solution. |
After talking with people at US PyCon I've changed my mind. @lysyloren would you make a Pull Request for it? |
Sorry, I have couple of urgent projects and no time for making this Pull Request for now. Beside of this, the implementation of multidict is now based on |
Hmm, it's complicated question. At first we should support Python 3.4 and 3.5. We'll drop 3.4 this Autumn or Winter most likely but 3.5 remains the showstopper. At second we use multidicts mostly for relative small dictionaries: HTTP headers and data provided by GET and POST requests. All these approaches make sense to be applied but we need to test them and measure performance carefully. |
Fixed by #87 |
When updating existing key in multidict, it is moved to the end (original order is not preserved):
In above example, guarantee of preserving insertion order should leave existing key
'1'
on its original first position.The text was updated successfully, but these errors were encountered: