The meaning of dict.keys, etc, will not change for the 2.x series.  For 
3.0, I believe that Guido already intends that .keys() no longer return a 
separate list.  For one thing, a major, if not the main use, of the method 
is for iteration, as in 'for keys in d.keys():'.  For this, creating and 
them discarding a separate list is inefficient and, in a sense, silly.

One option is to make .keys be what .iterkeys is today.  Another, more 
recent, is to make .keys return a new iterable dict view object, details 
not yet worked out.  Either way, one would make an independent set or list 
with set(d.keys()) or list(d.keys)).

Terry Jan Reedy



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to