Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

> Could you list some cases where this will give the wrong advice?

Guido already listed them. Library functions, static and class methods, and 
names like slf and _self (used either in local classes and wrapper functions to 
avoid conflict with the self parameter of the outer method or as a poor 
positional-only parameter).

> We have other errors where we are not completely sure and we formulate the 
> suggestion as a question. Some examples are the new error for incomplete 
> imports and some missing coma errors.

There were reasons for adding that suggestions. An error with partial recursive 
import is pretty common, but the error message did not have any clue about the 
prevalent cause of error.

The problem with missing comma in a sequence is that since the code is always 
multiline, the traceback never contains enough information about the problem. 
And we are sure that the only case when the suggestion is wrong is when you 
intentionally wrote incorrect code.

The problem with missing "self" does not look so common and hard to correctly 
determine as the above examples. We want to keep the interpreter so simple as 
possible, and the proposed feature looks to me far the bar of compromise.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42978>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to