New submission from Pablo Galindo Salgado <pablog...@gmail.com>:

We currently say:

Traceback (most recent call last):
  File "/Users/pgalindo3/github/python/master/lel.py", line 5, in <module>
    A().foo(1,2)
TypeError: foo() takes 2 positional arguments but 3 were given

but we should say:
Traceback (most recent call last):
  File "/Users/pgalindo3/github/python/master/lel.py", line 5, in <module>
    A().foo(1,2)
TypeError: A.foo() takes 2 positional arguments but 3 were given. Did you 
forget 'self' in the method definition?

----------
messages: 385349
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Improve error message when "self" is missing from the method definition

_______________________________________
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