On Sat, Jan 8, 2011 at 11:30 AM, Ronan Lamy <ronan.l...@gmail.com> wrote: > Le vendredi 07 janvier 2011 à 20:07 -0700, Aaron S. Meurer a écrit : >> So I have fixed all of the priority issues. I just need people to >> finish reviewing them (they are the pull requests at >> https://github.com/sympy/sympy/pulls/asmeurer that do not already have >> a "+1" in the comments). I haven't pushed anything in yet because I >> plan on doing it in one fell swoop after everything is reviewed to >> make it simpler. > > Why do you want to wait? If there are incompatibilities between the > commits, it'll be easier to solve them if we push them in one by one. >> >> But there is one final issue blocking the release, which is Issue 1376 >> (sympy.sum overrides built-in sum with a different call syntax). The reason >> I haven't fixed this one is that we need to make a decision about what to do >> with sum(). The problem is that we are overriding the Python builtin sum() >> with our own sum() that has a different calling syntax. >> >> Proposed solutions are: >> >> 1. Make our sum() act like Python's sum() when given a list. Mateusz has >> implemented this in his poly12 branch, but some people don't like it. >> >> 2. Rename our sum. Suggestions so far have been sum_() and summation().
I think this is the best option. Simply making the sympy sum act like Python's is still not desirable because the implementation and performance characteristics are different. Cheers, Brian >> 3. Just use Sum().doit(). This is the only suggest that I do not like, >> because it makes it look like Sum doesn't work if people don't know about >> doit(). >> >> 4. Keep overriding sum() and mention it in our docs. >> >> I am fine with any of these (except I really don't like 3), but we need to >> come to an agreement so that we can merge in polys12 and get the release out. > > The problem with 1. is that it conflates 2 distinct functions with > incompatible syntax and semantics under the same name. The builtin sum() > works with any iterable, so consider the case when you try to get the > sum of series whose generic term is iterable (e.g. a Tuple or some sort > of Vector class): what should sum(Tuple(k, k+1), (k,0,5)) return? And > what of sum(Tuple(k, k+1), 1)? > > I think we all agree that 3. and 4. are bad, so 2. is my preferred > solution. 'summate' is a bit awkward, but I think it's the best > suggestion - it's a verb and it doesn't contain an ugly and > unpronounceable underscore. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sy...@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > > -- Brian E. Granger, Ph.D. Assistant Professor of Physics Cal Poly State University, San Luis Obispo bgran...@calpoly.edu elliso...@gmail.com -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.