On Jan 17, 6:33 am, David Kohel <[EMAIL PROTECTED]> wrote: > This is my question: do we have functions which can return > different types depending on the arguments passed in? > Whatever its design flaws, it has been the philosophy that > this should not be the case in Magma. The alternative is > to have a different function: > > E1.is_isomorphic_with_isomorphism(E2) # or is_isomorphic_with_map > > I would like to hear from someone on the "correct" Python style. > Note that this syntax should be followed throughout the SAGE > language, in groups, rings, etc., so we should have a convention.
We do currently have several functions where the shape of the return value depends on the arguments. For example: sage: (4.0).sqrt() 2.00000000000000 sage: (4.0).sqrt(all=True) [2.00000000000000, -2.00000000000000] sage: x = polygen(ZZ) sage: (x^2-1).roots() [(1, 1), (-1, 1)] sage: (x^2-1).roots(multiplicities=False) [1, -1] Carl --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---