First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Executing g=R(f) calls the __call__ method for the ring R. You should read the documentation for this (by executing R.__call__?). In summary: given two polynomial rings U and R, if every generator of U is a generator for R, then R(f) does the obvious thing, mapping each generator of U to the generator of R with the same name. Otherwise, if U has at most as many generators as R, then map the ith generator of U to the ith generator of R. Otherwise, U must have more generators, so raise an error. Your case fits into this last situation.