On Thu, Aug 11, 2011 at 3:31 PM, Jim Jewett <[email protected]> wrote: > On Thu, Aug 11, 2011 at 5:22 PM, Jason Moore <[email protected]> wrote: >> Couple more thoughts on operator overloading. >>... The outer product >> doesn't really have a symbol on the keyboard. It often uses an x with a >> circle around it. Same with cross...the 'x' would be the best choice, but >> our language choice probably doesn't allow that. > > Have you looked at naming functions with unicode characters? I don't > remember how restrictive the rules ended up being, but you might well > be able to use mathematical characters in function names. For most > people, that interface would require cut-and-paste, but if one of the > APIs just forwards to another, that shouldn't be a severe problem.
Unicode variable names are only supported in Python 3, and anyway, this is a very bad idea (unless you can remember how to type • or × on your keyboard). > >> The only reason not to support all methods, would be if there is a reason >> for maintainability sake. Otherwise, more options are better, because more >> folks will be comfortable with using the program. > > It *may* matter depending on how important speed is. Given: > > def add3(x): > return x+3 > > add3(x) > > is still slower than > > x+3 > > because of function call overhead. > > -jJ > I seriously doubt that this would be an issue. Also, it depends on the implementation which one actually has more function calls. x + 3 calls x.__add__(3), which may then pass the logic onto something else. But this should basically be of zero consideration. Aaron Meurer -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
