Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 2012-02-11 07:26:55 -0600

DSM gravatar image

No, you've basically got it. To look at the docs for some object:

help(some_function)
some_function?
some_function?? # also shows the source code

The reason that help(simplify_full) didn't work was that it isn't an object which is in scope; it's a method, and methods are functions which live inside objects. As you have to type some_object.method() to call them, you need to type

help(Expression.simplify_full)
Expression.simplify_full?
Expression.simplify_full??

where Expression is the class, or if you have an object instance around like x, you could use that:

sage: type(x)
<type 'sage.symbolic.expression.Expression'>
sage: help(x.simplify_full)

Does that make sense? The help/?/?? things need access to an object, and it needs to be pretty direct.

[Technical note: help(sin(x)) will give you the help for the Expression class, because sin(x) is evaluated, it's an Expression instance, and so help() shows the docs for that. sin(x)? won't work, because the "?" tries to look to see whether the object before it exists, and there is no object called "sin(x)".]

No, you've basically got it. To look at the docs for some object:

help(some_function)
some_function?
some_function?? # also shows the source code

The reason that help(simplify_full) didn't work was that it isn't an object which is in scope; it's a method, and methods are functions which live inside objects. As you have to type some_object.method() to call them, you need to type

help(Expression.simplify_full)
Expression.simplify_full?
Expression.simplify_full??

where Expression is the class, or if you have an object instance around like x, you could use that:

sage: type(x)
<type 'sage.symbolic.expression.Expression'>
sage: help(x.simplify_full)
help(x.simplify_full) # or x.simplify_full?, or x.simplify_full??

Does that make sense? The help/?/?? things need access to an object, and it needs to be pretty direct.

[Technical note: help(sin(x)) will give you the help for the Expression class, because sin(x) is evaluated, it's an Expression instance, and so help() shows the docs for that. sin(x)? won't work, because the "?" tries to look to see whether the object before it exists, and there is no object called "sin(x)".]