#7776: Implements sage.misc.misc.inject_variable(name, value)
-------------------------------+--------------------------------------------
Reporter: nthiery | Owner: was
Type: enhancement | Status: closed
Priority: major | Milestone: sage-4.3.1
Component: user interface | Resolution: fixed
Keywords: | Work_issues:
Author: Nicolas M. ThiƩry | Upstream: N/A
Reviewer: Mike Hansen | Merged: sage-4.3.1.rc0
-------------------------------+--------------------------------------------
Comment(by nthiery):
Replying to [comment:6 jhpalmieri]:
> If I do
> {{{
> sage: inject_variable(3, 34) # pass a non-string to inject_variable,
which I probably shouldn't do
> }}}
> then tab-completion is broken. This is odd, and a little alarming.
Since this function isn't meant for casual users, maybe this isn't a big
deal, but otherwise, perhaps we should check that the first argument is a
string.
Thanks for catching this. Please review the trivial #7928 follow up!
> Here's another question:
> {{{
> sage: from sage.misc.misc import inject_variable
> sage: inject_variable('a', 23)
> sage: inject_variable('a', 26)
> /Applications/sage/local/bin/sage-ipython:1: RuntimeWarning: redefining
global value `a`
> #!/usr/bin/env python
> sage: inject_variable('a', 29)
> sage: inject_variable('a', 33)
> }}}
> Why is the warning only printed the first time? Is that just the nature
of these warnings?
Ah, I had not noticed this. It seems to be a feature of warn. I added a
comment in #7928.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7776#comment:8>
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.