[Python-3000] Thoughts on dictionary views
Jason Orendorff
jason.orendorff at gmail.com
Tue Feb 20 15:42:20 CET 2007
On 2/20/07, Raymond Hettinger <raymond.hettinger at verizon.net> wrote:
> * A dict is also one of Python's most basic APIs (along with lists). Ideally,
> we should keep those two APIs as simple as possible (getting rid of setdefault()
> and unneeded methods is a step in the right direction). IMO, the views will be
> the hardest part of the API to explain and interact with when learning the
> language [...]
I agree. Views will make dicts harder to learn for newcomers and
trickier to use even for experts.
The current non-aliasing behavior is a feature. Seen that way, the
switch to views seems like a broken optimization.
> * ISTM that views offer three benefits: re-iterability, set behavior, and
> self-updates. [...]
I think the benefit the team really liked was #4, "delete iterkeys(),
itervalues(), and iteritems() from the mapping API". But this now
seems like false economy to me.
-j
More information about the Python-3000
mailing list