Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Lib/collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,9 +1038,9 @@ def __repr__(self):
return f'{self.__class__.__name__}({", ".join(map(repr, self.maps))})'

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

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