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

Function _hash_add

Lib/dataclasses.py:943–949  ·  view source on GitHub ↗
(cls, fields, func_builder)

Source from the content-addressed store, hash-verified

941 cls.__hash__ = None
942
943def _hash_add(cls, fields, func_builder):
944 flds = [f for f in fields if (f.compare if f.hash is None else f.hash)]
945 self_tuple = _tuple_str('self', flds)
946 func_builder.add_fn('__hash__',
947 ('self',),
948 [f' return hash({self_tuple})'],
949 unconditional_add=True)
950
951def _hash_exception(cls, fields, func_builder):
952 # Raise an exception.

Callers

nothing calls this directly

Calls 2

_tuple_strFunction · 0.85
add_fnMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…