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

Method add_hash

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

Source from the content-addressed store, hash-verified

1064 return self
1065
1066 def add_hash(self):
1067 script, globs = _make_hash_script(
1068 self._cls,
1069 self._attrs,
1070 frozen=self._frozen,
1071 cache_hash=self._cache_hash,
1072 )
1073
1074 def attach_hash(cls_dict: dict, locs: dict) -> None:
1075 cls_dict["__hash__"] = self._add_method_dunders(locs["__hash__"])
1076
1077 self._script_snippets.append((script, globs, attach_hash))
1078
1079 return self
1080
1081 def add_init(self):
1082 script, globs, annotations = _make_init_script(

Callers 2

wrapFunction · 0.80
test_returns_selfMethod · 0.80

Calls 1

_make_hash_scriptFunction · 0.85

Tested by 1

test_returns_selfMethod · 0.64