[Python-ideas] (no subject)

Bernardo Sulzbach mafagafogigante at gmail.com
Tue Nov 29 00:45:04 EST 2016


On 2016-11-29 02:58, victor rajewski wrote:
> NameError: name 'reponse' is not defined
>
> A better message might be:
>
> You're trying to use the value of 'reponse', but that variable hasn't
> got a value yet. You can give it a value earlier in the code, or it
> could be a typo. You have a variable called 'response' - is that the one
> you meant?
>

This is a really nice feature. GHC and Clang do it for several things 
and it usually helps (when a live highlighter isn't available).

Given that these are HS students, presumably seeing Python for the first 
time, shouldn't they be using PyCharm to get used to PEP 8 (no l[10]=14) 
and other best practices (e.g., such as using 'with' instead of 
'try/finally' when possible)? This would provide live syntactic (and 
some semantic) highlighting with short human-readable messages.

Overall, I already find Python's exceptions quite readable, and your 
suggestions propose some VERY long lines which would certainly wrap at a 
terminal. Maybe this should be an optional feature.

-- 
Bernardo Sulzbach
http://www.mafagafogigante.org/
mafagafogigante at gmail.com


More information about the Python-ideas mailing list