[Python-ideas] Improve error message when missing 'self' in method definition

Yury Selivanov yselivanov.ml at gmail.com
Tue Oct 4 17:31:42 EDT 2016


On 2016-10-04 4:52 PM, Nathan Goldbaum wrote:

> Hi all,
>
> Recently pypy received a patch that improves the error message one gets
> when 'self' is missing in a method's signature:
>
> https://mail.python.org/pipermail/pypy-dev/2016-September/014678.html
>
> Here are the commits that implement the change in pypy:
>
> https://bitbucket.org/pypy/pypy/commits/all?search=branch(better-error-missing-self)
>
> I'm curious whether a similar improvement would also be received well in
> CPython. In particular, this guides one to the correct solution for a
> common programming mistake made by newcomers (and even not-so-newcomers).

+1 on the idea.

Yury



More information about the Python-ideas mailing list