<div dir="ltr">With Python's cooperative inheritance, I think you want to do everything through one constructor sending keyword arguments up the chain. The keyword arguments are popped off as needed. With this setup I don't think you need "overloaded constructors".<div><br></div><div>Best,</div><div>Neil</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 13, 2015 at 4:44 AM, Jonas Wielicki <span dir="ltr"><<a href="mailto:j.wielicki@sotecware.net" target="_blank">j.wielicki@sotecware.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If I may humbly chime in this, with a hint...<br>
<span class=""><br>
On 13.02.2015 05:01, Guido van Rossum wrote:<br>
> On Thu, Feb 12, 2015 at 7:41 PM, Ethan Furman <<a href="mailto:ethan@stoneleaf.us">ethan@stoneleaf.us</a>> wrote:<br>
</span>>> [snip]<br>
<span class="">>> 2) always use the type of self when creating new instances<br>
>><br>
>> pros:<br>
>> - subclasses automatically maintain type<br>
>> - much less code in the simple cases [1]<br>
>><br>
>> cons:<br>
>> - if constructor signatures change, must override all methods which<br>
>> create new objects<br>
>><br>
>> Unless there are powerful reasons against number 2 (such as performance,<br>
>> or the effort to affect the change), it sure<br>
>> seems like the nicer way to go.<br>
>><br>
>> So back to my original question: what other concerns are there, and has<br>
>> anybody done any benchmarks?<br>
>><br>
><br>
> Con for #2 is a showstopper. Forget about it.<br>
<br>
</span>I would like to mention that there is another language out there which<br>
knows about virtual constructors (virtual like in virtual methods, with<br>
signature match requirements and such), which is FreePascal (and Delphi,<br>
and I think original Object Pascal too).<br>
<br>
It is actually a feature I liked about these languages, compared to<br>
C++03 and others, that constructors could be virtual and that classes<br>
were first-class citizens.<br>
<br>
Of course, Python cannot check the signature at compile time. But I<br>
think as long as it is documented, there should be no reason not to<br>
allow and support it. It really is analogous to other methods which need<br>
to have a matching signature.<br>
<br>
just my two cents,<br>
jwi<br>
<br>
<br>
<br>
<br>
<br>_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/mistersheik%40gmail.com" target="_blank">https://mail.python.org/mailman/options/python-dev/mistersheik%40gmail.com</a><br>
<br></blockquote></div><br></div>