In _api.py, _raw flattens nested lists while _truncate does not.
I believe it would be best to not flatten a nested list. A flattened list would obscure issues like these:
expected: 1
2
3
4
5
6
actual: 1
2
[3, 4, 5]
6
(although, in Mismatch, _truncate is called before _raw, so Mismatch will never truly flatten a nested list).
Or perhaps, _raw should not apply new lines to lists at all, considering we want the raw representation of the object in string form.