MCPcopy
hub / github.com/fluentpython/example-code-2e / __init__

Function __init__

24-class-metaprog/factories.py:41–45  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

39 slots = parse_identifiers(field_names) # <3>
40
41 def __init__(self, *args, **kwargs) -> None: # <4>
42 attrs = dict(zip(self.__slots__, args))
43 attrs.update(kwargs)
44 for name, value in attrs.items():
45 setattr(self, name, value)
46
47 def __iter__(self) -> Iterator[Any]: # <5>
48 for name in self.__slots__:

Callers

nothing calls this directly

Calls 2

updateMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected