Also take a look at https://github.com/sympy/sympy/pull/2077.