The preparation of block copolymers of polyamides with heterocyclic polymers