If I use the notebook in Python only mode with 3.4.1.alpha0, and if
there is any exception, I always get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ondrej/.sage/sage_notebook/worksheets/ondrej/0/code/26.py",
line 6, in <module>
print _support_.syseval(python, ur'''from
sympy.printing.pretty.stringpict import stringPict''',
'/home/ondrej/.sage/sage_notebook/worksheets/ondrej/0/cells/8')
File "/home/ondrej/ext/sage-3.4.1.alpha0/local/lib/python2.5/site-packages/sage/server/support.py",
line 353, in syseval
return system.eval(cmd, sage_globals, locals = sage_globals)
AttributeError: 'function' object has no attribute 'eval'
no matter which exception was raised, which imho is some bug in the
notebook, isn't it? I would expect some traceback. I think it's
related to:
http://trac.sagemath.org/sage_trac/ticket/5282
Ondrej
I can't replicate it either anymore in a *new* worksheet. It's the
same sage instance, I kept it running over the night. However, in my
old worksheet, it still behaves the wrong way, screenshot attached.
I guess I just restart the worksheet and that will fix it, but then I
won't be able to reproduce it anymore.
Ondrej
Maybe you did something "stupid". E.g., if you do
python = lambda x: x^2
in an input cell, then you'll suddenly get the error you reported in
this thread.
William
You can see all the things I did in the screenshot. Ah, ok, I can see it now --
from sympy import *
imports "python":
In [1]: python?
Type: function
Base Class: <type 'function'>
String Form: <function python at 0x2d81848>
Namespace: Interactive
File: /home/ondrej/repos/sympy/sympy/printing/python.py
Definition: python(expr)
Docstring:
Return Python interpretation of passed expression
(can be passed to the exec() function without any modifications)
So that explains it. I didn't know I cannot use the word "python". We
should rename it anyway.
Ondrej