On Mon, Jun 2, 2008 at 7:17 AM, Jason Grout <[EMAIL PROTECTED]> wrote: > > kcrisman wrote: >> Referring to http://trac.sagemath.org/sage_trac/ticket/3212, I have to >> do a little cleaning up before submitting it for review, but have some >> code for allowing rescaling of matrices by "logical" scalars not in >> the base ring. However, in order to do this, I need to return a copy, >> not modify the original, and robertwb raises the point that perhaps >> then rescale_row etc. should *always* return a copy, for >> consistency. > > +1 to always returning a copy.
Do you have any idea what making this change is going to do to the generic echelonize() command? It's just not going to work at all or be insanely slow. > If *anything* is returned, I would expect it to be a copy. > > Note that one convention that I have observed in python is to return > None if an object is modified by a method. You see this in the sort() > method for lists, for example. We have also tried to follow this > convention in the graph theory code (and we've had this discussion > before when contemplating changing the graph theory code). It's not just a convention. In the Python language *all* functions return a value whether you use the return command or not. If you don't they default to returning None. William --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---