Make structured apart return separate function for num and denom:

In [3]: f = 36 / (x**5-2*x**4-2*x**3+4*x**2+x-2)

In [4]: apart_structured(f)
Out[4]:
(1,
 Poly(0, x, domain='ZZ'),
 [(Poly(x - 2, x, domain='ZZ'), Lambda(_a, 4), Lambda(_a, -_a + x), 1),
  (Poly(x**2 - 1, x, domain='ZZ'),
   Lambda(_a, -3*_a - 6),
   Lambda(_a, -_a + x),
   2),
  (Poly(x + 1, x, domain='ZZ'), Lambda(_a, -4), Lambda(_a, -_a + x), 1)])

In [5]: assemble_partfrac_full(_)
Out[5]: -4/(x + 1) - 3/(x + 1)**2 - 9/(x - 1)**2 + 4/(x - 2)

In [6]: pprint(_)
    4        3          9         4
- ───── - ──────── - ──────── + ─────
  x + 1          2          2   x - 2
          (x + 1)    (x - 1)