[issue1967] Backport dictviews to 2.7

Ezio Melotti report at bugs.python.org
Fri Dec 11 23:59:31 CET 2009


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

The patch (backport_dictviews.diff) doesn't seem to work for me. I
applied it on trunk after a svn up, did "./configure && make" and when I
tried d.view{items|keys|values} Python segfaulted:

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__,
+	     "D.keys() -> a set-like object providing a view on D's keys");

This should be "D.viewkeys() -> ...", same with the other two.

----------
keywords: +needs review -26backport
nosy: +ezio.melotti

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1967>
_______________________________________


More information about the Python-bugs-list mailing list