-
Notifications
You must be signed in to change notification settings - Fork 146
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
PMap values, keys, and items should be iterables in Python 3 #159
Comments
Thanks for reporting this! I'm happy to take a PR fixing this. Preferably including some benchmarks of before and after to justify any increase in code complexity (that may arise from supporting both Python 2 and 3). |
This is not just a matter of efficiency, but of semantics. In Python 3, dict keys are considered set-like. In particular, their order isn't considered when comparing for equality. Currently, In [7]: a = {'x': 1, 'y': 2}
In [8]: b = {'y': 2, 'x': 1}
In [9]: a.keys() == b.keys()
Out[9]: True
In [10]: pyrsistent.pmap(a).keys() == pyrsistent.pmap(b).keys()
Out[10]: False |
Interesting. I would suggest you open another issue for this ( |
Fixes issue #159 and greatly speeds up iteration of PMap in Python3
Currently they wrap them into
pvector
which is not as efficient as it could be in Python 3.The text was updated successfully, but these errors were encountered: