It would be slightly politer to use `isinstance(params, Mapping)` and then `isinstance(params, Sequence)`.