For people who don't want to click on links:
1. Allow hash and equality to be based on object identity, rather than
this is very important if one wants to store un-hashable objects in
(In my case: mostly dict's and numpy arrays).
2. Not subclassed from tuple. I have been bitten by this subclassing
when trying to set up
singledispatch on sequences and also on my classes.
3. Easily allow to specify default values. With namedtuple this
requires overriding __new__.
4. Easily allow to specify a conversion function. For example I have
some code like below:
note that I can store a numpy array while keeping hashability and
I can make it convert
to a numpy array in the constructor.
child = attr.ib()
matrix = attr.ib(convert=numpy.asarray)
I have one question about (4) -- how and when is the conversion function used, and what is its signature?