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

Skip to content

Commit c0d3f4e

Browse files
committed
Rephrase dict.fromkeys() news.
1 parent caf17be commit c0d3f4e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Misc/NEWS

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,11 @@ Core and builtins
270270
an optional argument that specifies the characters to strip. For
271271
example, "Foo!!!?!?!?".rstrip("?!") -> "Foo".
272272

273-
- Dictionaries have a new class method, fromkeys(iterable, value=None).
274-
It constructs a new dictionary with keys taken from the iterable and
275-
all values set to a single value. It is used for building membership
276-
tests and for removing duplicates from sequences.
273+
- There's a new dictionary constructor (a class method of the dict
274+
class), dict.fromkeys(iterable, value=None). It constructs a
275+
dictionary with keys taken from the iterable and all values set to a
276+
single value. It can be used for building sets and for removing
277+
duplicates from sequences.
277278

278279
- Added a new dict method pop(key). This removes and returns the
279280
value corresponding to key. [SF patch #539949]

0 commit comments

Comments
 (0)