sagemath / sage-explorer

A Jupyter widget for exploring SageMath objects
GNU General Public License v2.0
6 stars 2 forks source link

Add __repr__ method to SageExplorer #46

Closed nthiery closed 4 years ago

nthiery commented 4 years ago

Current:

sage: from sage_explorer import explore
sage: explore(3)
SageExplorer(children=(VBox(children=(ExplorerTitle(children=(MathTitle(value='Exploring: 3', ...)

Proposal:

sage: explore(3)
SageExplorer(3)

Variant:

SageExplorer for 3, with properties "foo", "bar", "baz"

Side benefits: this could be used for testing.

zerline commented 4 years ago

Just did the simplest one with 15c766e2a8ab7e31

For the second: until now properties names list is not a SageExplorer attribute.

The list of "explorables" (ie objects, not just strings) is an ExplorerProperties attribute. So the code could be like:

w = explore(42)
[e.name for e in w.propsbox.explorables]
nthiery commented 4 years ago

Just did the simplest one with 15c766e2a8ab7e31

Thanks!

For the second: until now properties names list is not a SageExplorer attribute. The list of "explorables" (ie objects, not just strings) is an ExplorerProperties attribute. So the code could be like:

w = explore(42)
[e.name for e in w.propsbox.explorables]

Sounds good.