<div dir="ltr">Yeah, I just checked the source and tried changing it. Seems to work well.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 25, 2016 at 8:11 PM, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Oct 25, 2016 at 04:55:21PM -0500, Ryan Gonzalez wrote:<br>
> Also, as an extension of this idea, would it be possible to improve errors<br>
> like this:<br>
><br>
><br>
> class X: pass<br>
> X() # object() takes no parameters<br>
><br>
><br>
> to show the actual type instead of just 'object'?<br>
<br>
</span>My wild guess is that the cause is that __new__ looks like this:<br>
<br>
class object():<br>
def __new__(cls, *args):<br>
if args:<br>
raise TypeError('object() takes no parameters')<br>
<br>
<br>
Except in C, of course.<br>
<br>
This is probably a left-over from the days when object() took and<br>
ignored any parameters. If my guess is close, then maybe we can do this:<br>
<br>
if args:<br>
raise TypeError('%s() takes no parameters' % cls.__name__)<br>
<br>
<br>
or equivalent.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Steve<br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</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>