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

2016-10-13 Thread Steven D'Aprano
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 > wrote: > > Chris Angelico writes: > > > > > Given that it's not changing semantics at all, just adding info/hints > > > to an error

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

2016-10-10 Thread Stephen J. Turnbull
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. I seem to recall that that is considered a blocker for this kind of change

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

2016-10-05 Thread אלעזר
Isn't it possible to implement it as a pure Python exception hook? On Wed, Oct 5, 2016 at 10:04 PM Ivan Levkivskyi wrote: > > On 5 October 2016 at 20:55, Yury Selivanov > wrote: > > > Speaking of, I'm not much of a C hacker, and messing with

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

2016-10-05 Thread Ivan Levkivskyi
On 5 October 2016 at 20:55, Yury Selivanov wrote: > > Speaking of, I'm not much of a C hacker, and messing with CPython internals >> is a little daunting. If anyone wants to take this on, you have my >> blessing. I also may take a shot at implementing this idea in the

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

2016-10-05 Thread Chris Angelico
On Thu, Oct 6, 2016 at 5:27 AM, Michel Desmoulin wrote: > +1. Python does need better error messages. This and the recent new import > exception will really help. > > Will feature freeze prevent this to get into 3.6 if some champion it? > Given that it's not changing

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

2016-10-05 Thread Stephan Houben
+∞ Another long-time user here who occasionally still makes this mistake. Stephan 2016-10-05 19:29 GMT+02:00 Paul Moore : > On 5 October 2016 at 18:17, Lisa Roach wrote: > > +1 > > > > I've definitely seen a lot of new users make this error, an

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

2016-10-05 Thread Paul Moore
On 5 October 2016 at 18:17, Lisa Roach wrote: > +1 > > I've definitely seen a lot of new users make this error, an improved message > could go a long way. I'm not a new user by any means, and I still regularly make this mistake. Because I've got the experience, I recognise

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

2016-10-05 Thread Lisa Roach
+1 I've definitely seen a lot of new users make this error, an improved message could go a long way. On Tue, Oct 4, 2016 at 1: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

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

2016-10-05 Thread Sylvain Desodt
Hi all, A bit of shameless self-promotion but in case anyone interested, a while ago, I had started to work on a project to improve error message. In case anyone's interested, you can found everything at: https://github.com/SylvainDe/DidYouMean-Python . It can be invoked in different ways, one of

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

2016-10-04 Thread Yury Selivanov
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