diff options
author | Barry Warsaw <barry@python.org> | 2001-06-26 20:12:50 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2001-06-26 20:12:50 (GMT) |
commit | 51acc8d3631d2da9fa61a62974dc5f448b854704 (patch) | |
tree | e12596a1023f463e1f003903dd0f3476a4d44584 /Misc | |
parent | 41775385df37af23ede71dad81d5f59df42f8dbd (diff) | |
download | cpython-51acc8d3631d2da9fa61a62974dc5f448b854704.zip cpython-51acc8d3631d2da9fa61a62974dc5f448b854704.tar.gz cpython-51acc8d3631d2da9fa61a62974dc5f448b854704.tar.bz2 |
Add an item about the extension to {}.update() to allow generic
mapping objects as an argument.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -90,6 +90,11 @@ Core - Dictionary objects now support the "in" operator: "x in dict" means the same as dict.has_key(x). +- The update() method of dictionaries now accepts generic mapping + objects. Specifically the argument object must support the .keys() + and __getitem__() methods. This allows you to say, for example, + {}.update(UserDict()) + - Iterators were added; this is a generalized way of providing values to a for loop. See PEP 234. There's a new built-in function iter() to return an iterator. There's a new protocol to get the next value |