Hi kcrisman, On Fri, Oct 31, 2008 at 12:22 AM, kcrisman <[EMAIL PROTECTED]> wrote: > >> >> Yes. Could you please post the said link. I really want to know what >> caused the problem you're describing. > > http://math.uchicago.edu/~crisman/Weird_Notebook_Behavior.sws > > I would try it out sagenb.org, but... :) However, I did try it on our > departmental server (which is 3.0.4, I think) and it also blew up. > > Sample function which causes problems: > > sage: def plot_or_not(): > ....: ''' > ....: What's up with this? x^3 > ....: ''' > ....: f(x)=x^3 > ------------------------------------------------------------ > File "<ipython console>", line 5 > SyntaxError: can't assign to function call (<ipython console>, line 5) > > Experimentation reveals that the apostrophe is causing the trouble. > As you can see, I now have had time to try this in the console, as > well as the other problems on the linked worksheet, so I'm baffled. > > I hope it's not my architecture - PPC OSX.4.
OK, here's my experimentation from within the console sage-3.1.4, x86 machine, Debian 5.0 Lenny (testing): Yep, I received a similar error as you described: sage: def foo(): ....: ''' ....: What's up with this? x^3 ....: ''' ....: f(x) = x^3 ------------------------------------------------------------ File "<ipython console>", line 5 SyntaxError: can't assign to function call (<ipython console>, line 5) John's suggestion about replacing the ''' with r''' results in the same error: sage: def foo(): ....: r''' ....: What's up with this? x^3 ....: ''' ....: f(x) = x^3 ------------------------------------------------------------ File "<ipython console>", line 5 SyntaxError: can't assign to function call (<ipython console>, line 5) As Simon has said, the error seems to go away when I used triple " (double quotation mark, not single quotation mark), which I normally do anyway whenever I write docstring. But using triple ''' with or without the leading r, and with or without the question mark, resulted in a siimilar error: sage: def foo(): ....: ''' ....: What's up with this? x^3 ....: ''' ....: f(x) = x^3 ------------------------------------------------------------ File "<ipython console>", line 5 SyntaxError: can't assign to function call (<ipython console>, line 5) sage: def foo(): ....: r''' ....: What's up here x^3 ....: ''' ....: f(x) = x^3 ------------------------------------------------------------ File "<ipython console>", line 5 SyntaxError: can't assign to function call (<ipython console>, line 5) -- Regards Minh Van Nguyen Web: http://nguyenminh2.googlepages.com Blog: http://mvngu.wordpress.com --~--~---------~--~----~------------~-------~--~----~ 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/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
