Skip to content

Derives: Custom behavior (Reference)

This page lists the dunder hooks used to customize derived behavior.

See also:


Dunder hooks

Hook Purpose
__str__ Display formatting ({value})
__eq__ Equality (==, !=)
__lt__ Ordering (<, sorting)
__hash__ Hashing (Set / Dict keys)

Rule:

  • You must not combine a hook with the corresponding @derive(...) (conflict).