[Python-ideas] (no subject)

Mariatta Wijaya mariatta.wijaya at gmail.com
Tue Nov 29 02:41:21 EST 2016


I'm +1 to the idea of improving error messages :)
(but maybe not to the exact new error messages proposed)

Raymond Hettinger touched on this topic during his Pycon Canada keynote, as
one of the positive contributions that you can do to cpython.

>

> Traceback (most recent call last):

>

>  File "foo.py", line 2, in <module>

>

>    print(length(l))

>

> NameError: name 'length' is not defined

>

> A better message might be:

>

> Python doesn't recognise the function "length". Did you mean len?'

>

I recall he gave a similar example to this, where Python could suggest an
alternative in case of typo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161128/a384c497/attachment.html>


More information about the Python-ideas mailing list