[Python-3000] docstring for dict.values

Lisandro Dalcin dalcinl at gmail.com
Fri Jul 27 18:51:46 CEST 2007


It seems the same applies to dict.items() ...

$ set(dict(a=[]).items())
>>> set(dict(a=[]).items())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'


On 7/27/07, Guido van Rossum <guido at python.org> wrote:
> On 7/27/07, Lisandro Dalcin <dalcinl at gmail.com> wrote:
> > Why the docstrings for 'dict.values' says "a set-like object ..." ??
> >
> > >>> list(dict(a=1,b=1,c=1).values())
> > [1, 1, 1]
>
> Oops, that's a bug! Thanks for reporting.

-- 
Lisandro Dalcín


More information about the Python-3000 mailing list