Ask Your Question
1

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

asked 14 years ago

ccanonc gravatar image

updated 13 years ago

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


Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 14 years ago

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.

Preview: (hide)
link

Comments

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

ccanonc gravatar imageccanonc ( 14 years ago )

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: 14 years ago

Seen: 487 times

Last updated: Sep 10 '10