Ram Rachum <[email protected]> added the comment:
Here is a short IPython session:
In [1]: class Foo:
...: def __init__(self, x):
...: pass
...:
In [2]: Foo(7, 8)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-efa33418c6bb> in <module>
----> 1 Foo(7, 8)
TypeError: __init__() takes 2 positional arguments but 3 were given
As you can see, it's pretty simple to get this exception text, so I'm not sure
why you didn't get that text. This is on Python 3.8.1.
Regarding you saying it's more annoying than useful: Especially for methods
such as `__init__`, it's often difficult to understand which class is being
instantiated, especially in a complex codebase. It happened to me last week at
work, and even with a debugger and being an experienced Python developer, it
took me a few minutes to figure out which `__init__` method was being called.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39212>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com