MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / __init__

Method __init__

example_code/item_065.py:94–98  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

92 fields = () # Must be in CSV column order
93
94 def __init__(self, **kwargs):
95 for key, value in kwargs.items():
96 if key not in type(self).fields:
97 raise TypeError(f"Invalid field: {key}")
98 setattr(self, key, value)
99
100 @classmethod
101 def from_row(cls, row):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected