Could `TypeError` be used? Some `ValueError` should perhaps be changed to `AttributeError`.
Could
TypeErrorbe used? SomeValueErrorshould perhaps be changed toAttributeError.