Could be shortened to
```python
if isinstance(ctxt.param_type, (QuantityType, ConstantType))
```