Is there a way to evaluate a string in the current scope?
So that
sage: expression
and
sage: some_evaluate(str(expression))
give the same thing at the same place.
I know about sage_eval, but it seems to need a dictionary of everything in the local scope.
For instance,
sage: a=3
sage: a^2
9
sage: some_evaluate('a^2')
9
instead of
sage: a=3
sage: sage_eval('a^2')
NameError: name 'a' is not defined
(of course this is a trivial example).
Guillermo