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

Nick Coghlan ncoghlan at gmail.com
Fri Oct 14 10:33:09 EDT 2016


On 14 October 2016 at 00:04, Steven D'Aprano <steve at pearwood.info> wrote:
> Error messages are not part of Python's public API. We should be able to
> change error messages at any time, including point releases.
>
> Nevertheless, we shouldn't abuse that right. If it's only a change to
> the error message, and not a functional change, then maybe we can add it
> to the next 3.6 beta or rc. But its probably not worth backporting it to
> older versions.

My working assumptions for this:

- students will move to the latest Python relatively quickly* ->
changes aimed at newcomers can just go in the next feature release
- production systems migrate slowly* -> changes aimed at making
obscure failures easier to debug go into maintenance releases

Neither is a hard-and-fast rule, but they're my default starting points.

Cheers,
Nick.

*"quickly" and "slowly" are truly relative here - Python 2.6 is still
pretty widely supported and used for production services, but if
students are learning on anything other than Python 3.5, it's likely
to be 2.7.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list