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

Steven D'Aprano steve at pearwood.info
Thu Oct 13 10:04:38 EDT 2016


On Tue, Oct 11, 2016 at 02:31:25PM +1100, Chris Angelico wrote:
> On Tue, Oct 11, 2016 at 2:29 PM, Stephen J. Turnbull
> <turnbull.stephen.fw at u.tsukuba.ac.jp> wrote:
> > Chris Angelico writes:
> >
> >  > Given that it's not changing semantics at all, just adding info/hints
> >  > to an error message, it could well be added in a point release.
> >
> > But it does change semantics, specifically for doctests.
> 
> Blah, forgot about doctests. Guess that's off the cards for a point
> release, then, but still, shouldn't be a big deal for 3.7.

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.



-- 
Steve


More information about the Python-ideas mailing list