Commit Graph

5 Commits

Author SHA1 Message Date
Guido van Rossum d9214d1f2c Make dict.keys() and dict.items() comparable to sets, using == and !=.
(PEP 3106 requires subset comparisons too, those will come later if someone
really wants them. :-)
2007-02-12 02:23:40 +00:00
Guido van Rossum cc2b016125 - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
and .keys(), .items(), .values() return dict views.

The dict views aren't fully functional yet; in particular, they can't
be compared to sets yet.  but they are useful as "iterator wells".

There are still 27 failing unit tests; I expect that many of these
have fairly trivial fixes, but there are so many, I could use help.
2007-02-11 06:12:03 +00:00
Guido van Rossum 3ac6741f79 Implement __contains__ for dict_keys and dict_items.
(Not for dict_values, where it can't be done faster than
the default implementation which just iterates the elements.)
2007-02-10 18:55:06 +00:00
Guido van Rossum 83825acd1b Endow dict views with a proper length method. 2007-02-10 04:54:19 +00:00
Guido van Rossum b90c84889e Very preliminary work on dict views. 2007-02-10 01:11:45 +00:00