Ask Your Question

Why are Notebook docs different from CLI docs? What is Namespace "Interactive"?

asked 2010-09-09 17:07:04 -0500

ccanonc gravatar image

updated 2011-04-28 09:04:27 -0500

Kelvin Li gravatar image

The sage terminal returns the following, but the notebook interface omits the "Base Class", "String Form", "Namespace", and "Length":

sage: NaN?
Type: Expression
Base Class: type 'sage.symbolic.expression.Expression'
String Form: NaN
Namespace: Interactive
Length: 0
File: /SAGE_DIR/local/lib/python2.6/site-packages/sage/categories/
Definition: NaN(self, *args, **kwds)
        x.__init__(...) initializes x; see x.__class__.__doc__ for signature

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2010-09-09 19:03:42 -0500

The notebook docs are different from the CLI docs because they're prepared differently. The command-line docs are prepared using code from the file devel/sage/sage/misc/, which is then fed into ipython, and I think ipython adds the extra fields "Base Class", etc. The notebook docs are prepared using similar code, plus code from the notebook: see local/lib/python/site-packages/sagenb-.../sagenb/misc/ This takes care of the nice formatting, the color, etc. It doesn't use ipython, though, so those fields are missing.

edit flag offensive delete link more


It would be nice if they were consistent as far as content. The ipython evaluation is more informative.

ccanonc gravatar imageccanonc ( 2010-09-10 05:32:11 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2010-09-09 17:07:04 -0500

Seen: 221 times

Last updated: Sep 09 '10