Ask Your Question
1

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

asked 2010-09-10 00:07:04 +0100

ccanonc gravatar image

updated 2011-04-28 16:04:27 +0100

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/commutative_rings.py
Definition: NaN(self, *args, **kwds)
Docstring:
        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
2

answered 2010-09-10 02:03:42 +0100

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/sagedoc.py, 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/support.py. 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

Comments

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

ccanonc gravatar imageccanonc ( 2010-09-10 12:32:11 +0100 )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

Stats

Asked: 2010-09-10 00:07:04 +0100

Seen: 468 times

Last updated: Sep 10 '10