Argument type validation with user-friendly error messages

Again, use parens to break long lines:

```python
        msg = 'Expected type {0} for {1}, got {2}'.format(
            TYPES.get(self.type, self.type.__name__),
            name,
            TYPES.get(type(ret), type(ret).__name__)
        )
```