On Thu, Apr 2, 2015 at 7:57 AM, Jori Mantysalo <jori.mantys...@uta.fi> wrote: > On Thu, 2 Apr 2015, William Stein wrote: > >>>> We could translate en dash into hypen on the commandline to avoid that >>>> surprise... > > >> Another idea would be to do something only if an exception is actually >> raised. I.e., if a user interactively runs some block of input (in a >> notebook, command line, whatever), and it raises an exception, we >> could have a library of tests we run on that input which could then be >> used to provide further help to the user. > > > That would be great. First one could be just checking parenthesis, i.e. > saying something meaninful to "sin(log(x)". >
Great idea. Look at the error from that one: "SyntaxError: unexpected EOF while parsing" A typical new user who doesn't program might see that and think: - what's a "syntaxerror" (imagine them pronouncing it syntax-err-or) - EOF? is that like WTF? - what is parsing? The hint could say: "You definitely forgot to include a close parenthesis, since you have two open parenthesis and only one close parenthesis." > Different kinds of minus sign can be copypasted from PDF or even from Word. > Maybe also multiplication signs(?). Yep. And quotes and many other funny unicode things. We could have a whole table of hint substitutions. I think what I'm proposing would best be done as a new Python library that we could develop on github and include in sage periodically. It could be useful for other projects to include, e.g., sympy. It would have to be sage aware of course (e.g., try: import sage.all...). What to name it? My first thought is "pyerr", which seems like the canonical name of a Python "error library", whatever that means. -- William -- William (http://wstein.org) -- 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.