Yes, exactly like range ....<br><a href="http://coverage.livinglogic.de/Demo/classes/Range.py.html">http://coverage.livinglogic.de/Demo/classes/Range.py.html</a><br>see handleargs function. Well that's short, but that's still too much code for what I want to do ;-)<br>

<br><br><div class="gmail_quote">On Thu, Feb 2, 2012 at 7:43 PM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On 2/2/2012 8:09 PM, Emmanuel Mayssat wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello all,<br>
<br>
I would like to instantiate my class as follow<br>
<br>
<br>
QObject(<param1>, <parent>)<br>
QObject(<parent>)<br>
<br>
an example would be<br>
<a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qmenu.html" target="_blank">http://www.riverbankcomputing.<u></u>co.uk/static/Docs/PyQt4/html/<u></u>qmenu.html</a><br>
<br>
How can I do this without have to specify parent=<parent> in the second<br>
version<br>
(I always need to supply the parent parameter, but I would like to<br>
supply it last)<br>
</blockquote>
<br></div>
The same way range(stop) versus range(start,stop) works.<br>
But I really recommend against that api.<br>
It makes both doc and code messy.<br>
You need a really good reason to not use the obvious<br>
def __init__(self, parent, param=default):...<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Terry Jan Reedy<br>
<br>
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br>