Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168759
Image: ubuntu2004

This worksheet demonstrates a bug in Sage:

If the cells in this worksheets are evaluated in order then the last result will be 1.

If the worksheet is executed by selecting "Action - Evaluate all" from the menu the second cell will be evaluated after the third cell, resulting in an error. The same issue occurs if the command "%auto" is used for automatic evaluation in all cells.

reset()
@interact def f(m=(1..10)): global a a = m show(a)
[removed]
[removed]
[removed]
[removed]
a
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_37.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("YQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpVibOVW/___code___.py", line 2, in <module> exec compile(u'a' + '\n', '', 'single') File "", line 1, in <module> NameError: name 'a' is not defined