MCPcopy Index your code
hub / github.com/python/cpython / fromkeys

Method fromkeys

Lib/collections/__init__.py:1095–1097  ·  view source on GitHub ↗

Create a new ChainMap with keys from iterable and values set to value.

(cls, iterable, value=None, /)

Source from the content-addressed store, hash-verified

1093
1094 @classmethod
1095 def fromkeys(cls, iterable, value=None, /):
1096 'Create a new ChainMap with keys from iterable and values set to value.'
1097 return cls(dict.fromkeys(iterable, value))
1098
1099 def copy(self):
1100 'New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]'

Callers

nothing calls this directly

Calls 2

clsClass · 0.50
fromkeysMethod · 0.45

Tested by

no test coverage detected