#8734: make sage variables unique in maxima
-------------------------------------+-------------------------------------
Reporter: jason | Owner: jason
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.3
Component: interfaces | Resolution:
Keywords: | Merged in:
Authors: Jason Grout, Ralf | Reviewers: Volker Braun, Paul
Stephan | Zimmerman, Karl-Dieter Crisman
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/rws/ticket/8734-1 | 2c68026320ba3c516cd94fa1721e886ecd732804
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by rws):
Replying to [comment:44 nbruin]:
> For the
> {{{
> try:
> ....
> except ... as error:
> ...
> raise error
> }}}
> in maxima_lib.py (and possibly elsewhere):
> It's *much* better to reraise an error with a bare `raise` rather than
`raise error`, since the bare raise will leave the original traceback
intact, whereas the `raise error` will create a new traceback, obscuring
the actual source of the error.
In this case, yes. Else, are you requesting to rethrow the `RuntimeError`
from Maxima in all cases as `RuntimeError`? I'm asking because it appears
that preserving the stacktrace and throwing the more specific `ValueError`
appears possible:
http://www.gossamer-threads.com/lists/python/python/947257
{{{
In Python 3 you could chain the exceptions with:
except Exception as e:
raise CustomException() from e
There is no such syntax in Python 2, but you could manually store and
retrieve the __cause__ and __traceback__ attributes similarly to the
way Python 3 does it. See PEP 3134 for full details.
}}}
http://legacy.python.org/dev/peps/pep-3134/
{{{
Sometimes it can be useful for an exception handler to intentionally
re-raise an exception, either to provide extra information or to
translate an exception to another type. ...
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/8734#comment:45>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.