#5220: [with patch, needs review] Weird or non-appearance of default in
input_box
in interact
----------------------+-----------------------------------------------------
Reporter: kcrisman | Owner: boothby
Type: defect | Status: new
Priority: major | Milestone: sage-3.4.1
Component: notebook | Keywords:
----------------------+-----------------------------------------------------
Comment(by jason):
P.S. I can see why having
{{{
@interact
def plotfunction(f=input_box('x^2')):
print f
}}}
produce x^2 in the input box would be good too, though. There are lots of
types in Sage for which repr does not give you back a string that can be
used to reconstruct the object. For example, I believe that after the
patch,
{{{
@interact
def plotfunction(f=input_box(RIF(3.2,3.4))):
print f
}}}
will produce an input box that has "3.3?" in it (without quotation marks).
Of course, this is nonsense. For that reason, I can see changing how
default values are handled to allow:
{{{
@interact
def plotfunction(f=input_box('RIF(3.2,3.4)')):
print f
}}}
to produce an input box with "RIF(3.2,3.4)" (without quotation marks) in
it. This means that to make an input box containing a string (with
quotation marks), you'll have to do something like:
{{{
@interact
def plotfunction(f=input_box("'my string'")):
print f
}}}
(i.e., double-quote your string).
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5220#comment:6>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---