Re: [Python-Dev] Add more SyntaxWarnings?

2019-01-29 Thread Nick Coghlan
On Tue, 29 Jan 2019 at 14:47, Stephen J. Turnbull
 wrote:
> I don't disagree.  I disagree with the conclusion that it's worth the
> effort to try to improve all error messages that confuse new users,
> because new users (by definition) don't know enough to respond
> usefully in many cases.  In those cases, they need to be told what's
> going on and why, where more experienced users can figure it out from
> their background knowledge of Python semantics.  Embedding a "theory
> of operations" note in every error message would be possible, but I
> don't think it's a good idea -- it would certainly make the language
> more annoying for experienced developers.

FWIW, we have pretty decent evidence that error messages don't have to
provide a wonderful explanation on their own in order to be helpful:
they just need to be distinctive enough that a web search will
reliably get you to a page that gives you relevant information.

Pre-seeded answers on Stack Overflow are excellent for handling the
second half of that approach (see [1] for a specific example).

Cheers,
Nick.

[1] 
https://stackoverflow.com/questions/25445439/what-does-syntaxerror-missing-parentheses-in-call-to-print-mean-in-python

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Add more SyntaxWarnings?

2019-01-29 Thread MRAB

On 2019-01-29 13:44, Nick Coghlan wrote:

On Tue, 29 Jan 2019 at 14:47, Stephen J. Turnbull
 wrote:

I don't disagree.  I disagree with the conclusion that it's worth the
effort to try to improve all error messages that confuse new users,
because new users (by definition) don't know enough to respond
usefully in many cases.  In those cases, they need to be told what's
going on and why, where more experienced users can figure it out from
their background knowledge of Python semantics.  Embedding a "theory
of operations" note in every error message would be possible, but I
don't think it's a good idea -- it would certainly make the language
more annoying for experienced developers.


FWIW, we have pretty decent evidence that error messages don't have to
provide a wonderful explanation on their own in order to be helpful:
they just need to be distinctive enough that a web search will
reliably get you to a page that gives you relevant information.

Pre-seeded answers on Stack Overflow are excellent for handling the
second half of that approach (see [1] for a specific example).

Cheers,
Nick.

[1] 
https://stackoverflow.com/questions/25445439/what-does-syntaxerror-missing-parentheses-in-call-to-print-mean-in-python

I have a vague recollection that a certain computer system (Amiga?) had 
a 'why' command. If it reported an error, you could type "why" and it 
would give you more details.


I suspect that all that was happening was that when the error occurred 
it would store the additional details somewhere that the 'why' command 
would simply retrieve.

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Add more SyntaxWarnings?

2019-01-29 Thread Paul Sokolovsky
Hello,

On Tue, 29 Jan 2019 18:55:37 +
MRAB  wrote:

[]

> > https://stackoverflow.com/questions/25445439/what-does-syntaxerror-missing-parentheses-in-call-to-print-mean-in-python
> >  
> I have a vague recollection that a certain computer system (Amiga?)
> had a 'why' command. If it reported an error, you could type "why"
> and it would give you more details.
> 
> I suspect that all that was happening was that when the error
> occurred it would store the additional details somewhere that the
> 'why' command would simply retrieve.

Well, a typical Linux install includes "errno" util:

$ errno 13
EACCES 13 Permission denied

So, hail to error numbers. And indeed, even if some may think they're
artifact of 1980'ies, they're alive, well, and useful:

$ pylint --help-msg W1651
:deprecated-itertools-function (W1651): *Accessing a deprecated function on the 
itertools module*
  Used when accessing a function on itertools that has been removed in Python 3.
  This message belongs to the python3 checker. It can't be emitted when using
  Python >= 3.0.


-- 
Best regards,
 Paul  mailto:pmis...@gmail.com
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com