#8738: @interact matrix input control ignores label
------------------------+---------------------------------------------------
Reporter: was | Owner: jason, was
Type: defect | Status: new
Priority: major | Milestone: sage-4.4
Component: notebook | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
Comment(by jason):
I don't have a development copy of sagenb right now (it'd be nice of the
local/lib/python2.6/site-packages/sagenb.../sagenb/notebook directory
contained the mercurial repository so we could easily just change things
and make a patch, without having to go get the spkg, extract it, install
it with the develop option, etc.)
However, to fix this, just change line 3750 of interact.py from:
{{{
C = input_grid(default.nrows(), default.ncols(),
default=default.list(), to_value=default.parent())
}}}
to
{{{
C = input_grid(default.nrows(), default.ncols(),
default=default.list(), to_value=default.parent(), label=label)
}}}
I have a comment about the design feature. I notice from the code that
this sets a default value *sometimes* (depending on the control):
{{{
@interact
def f(n=(2,[1,2,3,4,5])):
print n
}}}
However, this does *not set the default, because the first spot is
overloaded to mean "label" and "default value", and "label" takes
precedence:
{{{
@interact
def f(n=("b",["a","b","c"])):
print n
}}}
I think this interplay and double-meaning of the first argument confuses
things too much.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8738#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.