On Sat, Nov 7, 2015 at 3:24 PM, Nathann Cohen <nathann.co...@gmail.com>
wrote:

> We should follow Python; this has an added benefit of typically keeping
>> error messages more concise.
>>
>
> One very common occurrence of a long exception message are the
> PackageNotFoundError which happen when one calls a function which relies on
> a non-installed package:
>
>         PackageNotFoundError: the package 'my_package' was not found. You
> can install it by running 'sage -i my_package' in a shell
>
>
> Changing the convention would mean that those messages would not be
> allowed anymore. I do not see an easy way to be as informative if we change
> the convention, and for this reason I believe that the convention cannot be
> changed to "only one sentence at most". It is not practical, at least in
> this situation.
>
> Another instance, which may be more appealing to you:
>
>     sage: {Graph():1}
>     TypeError: This graph is mutable, and thus not hashable. Create an
> immutable copy by `g.copy(immutable=True)`
>
> Here again, I think that setting a limit of one sentence per exception
> message would only make out error messages *less* helpful.
>
> Thus, I stand for a standard which acknowledges our current usage of
> exception messages. If we were to adopt another rule, then the defenders of
> that proposal would be very kind to also propose alternate phrasing for the
> current multi-sentences exceptions.
>
> Nathann
>
> P.S.: We usually consider a Sage user to be less computer-savvy than a
> Python coder. That is another reason to have more explicit error messages
> than Python's.
>

I think that Nathann has a good point that suggesting ways to avoid an
error is a useful thing to have in an error message.  Perhaps we can say
something like "Conciseness is valued and complete sentences are not
required, but nontrivial information about how to avoid an error is
encouraged (if easy to state and widely applicable in contexts where the
error would be raised)."
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.
>

-- 
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