How to extract numerator and denominator from polynomial without evaluating?
<p>I have the following expression</p>

<pre><code>A=Symbol('A')
x=Symbol('x')
B=Symbol('B')
C=Symbol('C')
D=Symbol('D')
expression=((A**x-B-C)/(D-1))*(D-1)
n,d=fraction(expression)
</code></pre>

<p>I am getting following result:</p>

<pre><code>n=A**x-B-C
d=1
</code></pre>

<p>My expected result is</p>

<pre><code>n=(A**x-B-C)*(D-1)
d=(D-1)
</code></pre>

<p>Is there way in sympy or need to write customize function to handle that</p>