I see there were many asserts like this before your refactoring; I think it is a good chance to fix them. For example, asserts in `__eq__` and alike methods should be replaced with TypeErrors.