Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 51acc8d

Browse files
committed
Add an item about the extension to {}.update() to allow generic
mapping objects as an argument.
1 parent 4177538 commit 51acc8d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ Core
9090
- Dictionary objects now support the "in" operator: "x in dict" means
9191
the same as dict.has_key(x).
9292

93+
- The update() method of dictionaries now accepts generic mapping
94+
objects. Specifically the argument object must support the .keys()
95+
and __getitem__() methods. This allows you to say, for example,
96+
{}.update(UserDict())
97+
9398
- Iterators were added; this is a generalized way of providing values
9499
to a for loop. See PEP 234. There's a new built-in function iter()
95100
to return an iterator. There's a new protocol to get the next value

0 commit comments

Comments
 (0)