Using `isinstance` is sometimes necessary, but it isn't very Pythonic. Is there some way that you can check a property on the object for this test, instead of using `isinstance`? If the answer is "no", or "yes, but it would be very difficult and finicky", then `isinstance` is fine, but if the answer is "yes, and it's fairly straightforward", then do that, instead.