<div dir="ltr">Also, as an extension of this idea, would it be possible to improve errors like this:<div><br></div><div><br></div><div>class X: pass</div><div>X() # object() takes no parameters</div><div><br></div><div><br></div><div>to show the actual type instead of just 'object'?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 25, 2016 at 4:48 PM, Ryan Gonzalez <span dir="ltr"><<a href="mailto:rymg19@gmail.com" target="_blank">rymg19@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">So, based on everyone's feedback, I just created this:<div><br></div><div><a href="http://bugs.python.org/issue28536" target="_blank">http://bugs.python.org/<wbr>issue28536</a><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 24, 2016 at 5:07 PM, Ryan Gonzalez <span dir="ltr"><<a href="mailto:rymg19@gmail.com" target="_blank">rymg19@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I personally find it kind of annoying when you have code like this:<div><br></div><div><br></div><div>x = A(1, B(2, 3))</div><div><br></div><div><br></div><div>and Python's error message looks like this:</div><div><br></div><div><br></div><div><div>TypeError: __init__() takes 1 positional argument but 2 were given</div><div><br></div><div><br></div><div>It doesn't give much of a clue to which `__init__` is being called. At all.</div><div><br></div><div>The idea: when showing the function name in an error like this, show the fully qualified name, like:</div><div><br></div><div><br></div><div>TypeError: A.__init__() takes 1 positional argument but 2 were given<br></div><div><br></div><div><br></div><div>This would be MUCH more helpful!</div><div><br></div><div><br></div><div>Another related change would be to do the same thing in tracebacks:</div><div><br></div><div><br></div><div><div>Traceback (most recent call last):</div><div> File "<stdin>", line 1, in <module></div><div> File "<stdin>", line 2, in __init__</div><div>AssertionError</div></div><div><br></div><div><br></div><div>to:</div><div><br></div><div><br></div><div><div>Traceback (most recent call last):</div><div> File "<stdin>", line 1, in <module></div><div> File "<stdin>", line 2, in MyClass.__init__</div><div>AssertionError</div></div><div><br></div><div><br></div><div>which could make it easier to find where exactly an error originated.</div><span class="m_8613137110730352136HOEnZb"><font color="#888888"><div><div><br></div>-- <br><div class="m_8613137110730352136m_6145775279867860621gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Ryan<span style="font-size:12.8px"> </span><span style="font-size:12.8px">(ライアン)</span></div><div dir="ltr">[ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong.<br></div><div dir="ltr"><div><a href="http://kirbyfan64.github.io/" target="_blank">http://kirbyfan64.github.io/</a><div style="display:inline-block;width:16px;height:16px"> </div></div></div></div></div></div></div></div></div></div>
</div></font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_8613137110730352136gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Ryan<span style="font-size:12.8px"> </span><span style="font-size:12.8px">(ライアン)</span></div><div dir="ltr">[ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong.<br></div><div dir="ltr"><div><a href="http://kirbyfan64.github.io/" target="_blank">http://kirbyfan64.github.io/</a><div style="display:inline-block;width:16px;height:16px"> </div></div></div></div></div></div></div></div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Ryan<span style="font-size:12.8px"> </span><span style="font-size:12.8px">(ライアン)</span></div><div dir="ltr">[ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong.<br></div><div dir="ltr"><div><a href="http://kirbyfan64.github.io/" target="_blank">http://kirbyfan64.github.io/</a><div style="display:inline-block;width:16px;height:16px"> </div></div></div></div></div></div></div></div></div></div>
</div>