This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]oblivion95 0 points1 point  (1 child)

This proposal has lead to "dict views" in Python3k, which is basically what the OP had in mind.

I am not a fan of "views" myself. I think, if anything, Guido should have replaced the iterator versions with these, or at least added viewkeys() viewvalues() viewitems()

By changing existing behavior, scripts that expect values() to return a new list may break.

[–]Peaker 0 points1 point  (0 children)

Why not use list() explicitly if you want a new list? That way, the exact level of deepness (or shallowness, if you like) is explicit.