I have tested this with both sympy==1.7.1 and sympy==1.5.1 and get the same result.
sympy==1.7.1
sympy==1.5.1
from sympy import * import inspect THT,HT,DBH,d