10000 gh-117215 Make the fromskey() signature match dict.fromkeys(). (gh-11… · python/cpython@03f7aaf · GitHub
[go: up one dir, main page]

Skip to content

Commit 03f7aaf

Browse files
authored
gh-117215 Make the fromskey() signature match dict.fromkeys(). (gh-117493)
1 parent fc5f68e commit 03f7aaf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/collections/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,9 +1038,9 @@ def __repr__(self):
10381038
return f'{self.__class__.__name__}({", ".join(map(repr, self.maps))})'
10391039

10401040
@classmethod
1041-
def fromkeys(cls, iterable, *args):
1042-
'Create a ChainMap with a single dict created from the iterable.'
1043-
return cls(dict.fromkeys(iterable, *args))
1041+
def fromkeys(cls, iterable, value=None, /):
1042+
'Create a new ChainMap with keys from iterable and values set to value.'
1043+
return cls(dict.fromkeys(iterable, value))
10441044

10451045
def copy(self):
10461046
'New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]'

0 commit comments

Comments
 (0)
0