MCPcopy
hub / github.com/python-attrs/attrs / add_attrs_init

Method add_attrs_init

src/attr/_make.py:1117–1140  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1115 )
1116
1117 def add_attrs_init(self):
1118 script, globs, annotations = _make_init_script(
1119 self._cls,
1120 self._attrs,
1121 self._has_pre_init,
1122 self._pre_init_has_args,
1123 self._has_post_init,
1124 self._frozen,
1125 self._slots,
1126 self._cache_hash,
1127 self._base_attr_map,
1128 self._is_exc,
1129 self._on_setattr,
1130 attrs_init=True,
1131 )
1132
1133 def _attach_attrs_init(cls_dict, globs):
1134 init = globs["__attrs_init__"]
1135 init.__annotations__ = annotations
1136 cls_dict["__attrs_init__"] = self._add_method_dunders(init)
1137
1138 self._script_snippets.append((script, globs, _attach_attrs_init))
1139
1140 return self
1141
1142 def add_eq(self):
1143 cd = self._cls_dict

Callers 2

wrapFunction · 0.80
test_returns_selfMethod · 0.80

Calls 1

_make_init_scriptFunction · 0.85

Tested by 1

test_returns_selfMethod · 0.64