7 How to check if something is derivative?

import sympy 
x    = sympy.symbols('x') 
y    = sympy.Function('y') 
expr = sympy.Derivative(y(x),x) 
type(expr) is sympy.Derivative 
        #True 
 
if type(expr) is sympy.Derivative: 
   print("yes") 
 
         #yes
 

This also works, which seems to be the more prefered way

isinstance(expr,sympy.Derivative) 
   #True