>
> It is not obvious (for non-experts) that this is the elegant and preferred 
> route. It would be nice if this 'solution' was mentioned somewhere. 
>
>
This could be something to put in the Sage developer manual under 
conventions.
 

> As part of the function, or when an ValueError is raised, or on a Quick 
> Reference Card, or *no_except* becomes a standard function or ...
>
>>
>>  
Also, to be fair, we certainly don't always raise an error when a solution 
to something doesn't exist.  Such as in "solve()".  It's a fine line 
between deciding that user input error means anything can happen (Pari's 
usual attitude) and that every single user input error possible must be 
caught (nice idea but very, very time-consuming to implement).

I think in this case because 

> Write the integer n as a sum of two integer squares if possible;

and it doesn't give a full list of *all* ways to do so, the ValueError is 
appropriate.  But if it returned a list of all such squares (warning: don't 
try this at home), then an empty list would make sense.  Does that seem 
like a reasonable argument?  It's true that Python-based projects sometimes 
go very far in the "explicit is better than implicit" direction than is 
healthy ;-)

- kcrisman

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" 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-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to