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
Backport dictviews to 2.7 #46259
Comments
Patch to backport dictviews to trunk. Consists of some trickery:
|
After talking to Guido, got rid of the future import magic in favour of |
I'm going to defer this to 2.7. |
I have refreshed Thomas's patch to reflect recent updates to dictviews. |
Here is a patch for 2to3 to support the translation of code using dictviews. |
Can someone review the patches? I would like to commit this later this week. |
The patch (backport_dictviews.diff) doesn't seem to work for me. I Python 2.7a1+ (trunk:76759M, Dec 12 2009, 00:28:52)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> d = dict(a=3, b=5)
>>> d.viewitems()
Segmentation fault I'm tested it on Ubuntu 9.10. The docstrings of the three methods are also wrong: +PyDoc_STRVAR(viewkeys__doc__, This should be "D.viewkeys() -> ...", same with the other two. |
It looks like that crash is caused by some bug in the implementation of |
The tests were missing in my last patch. So, here's a new one. |
Committed in r77428. Thanks for your comments! |
It seems that 'viewkeys', 'viewvalues' and 'viewitems' methods were not added to types.DictProxyType, was that intentional? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: