On Thu, Nov 12, 2015 at 3:13 PM, Jori Mäntysalo <jori.mantys...@uta.fi>
wrote:

On Thu, 12 Nov 2015, Daniel Krenn wrote:
>
> True. Does this mean that you want to use x and y in the calling
>> function (e.g. catch the exception there and raise a different exception
>> explaining what is going on using x and y)?
>>
>
> Exactly that. Posets are, shortly said, a digraph with integers as
> vertices and a dictionary mapping them to elements. hasse_diagram.py might
> raise error if 7 and 13 has no meet, and I want to see that elements 'c'
> and 'r' has no meet.


Then Volker's suggestion of a custom exception class is probably what you
want.  You can have x and y be attributes of the exception, which are then
accessible to the calling function.
David

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to