just FYI: `isinstance` is the most common syntax for this in the code