'Returns the module generated by the union of ``self`` and ``other``.
>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(1)
>>> M = F.submodule([x**2 + x]) # <x(x+1)>
>>> N = F.submodule([x**2 - 1]) # <(x-1)(x+1)>
>>> M.union(N) == F.submodule([x+1])
True'

def union(self, other):

    if (not isinstance(other, SubModule)):
        raise TypeError(('%s    is    not    a    SubModule' % other))
    if (other.container != self.container):
        raise ValueError(('%s    is    contained    in    a    different    free    module' % other))
    return self.__class__((self.gens + other.gens), self.container)
