multiple constructor __init__
emayssat at gmail.com
Fri Feb 3 17:30:50 CET 2012
Yes, exactly like range ....
see handleargs function. Well that's short, but that's still too much code
for what I want to do ;-)
On Thu, Feb 2, 2012 at 7:43 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> On 2/2/2012 8:09 PM, Emmanuel Mayssat wrote:
>> Hello all,
>> I would like to instantiate my class as follow
>> QObject(<param1>, <parent>)
>> an example would be
>> How can I do this without have to specify parent=<parent> in the second
>> (I always need to supply the parent parameter, but I would like to
>> supply it last)
> The same way range(stop) versus range(start,stop) works.
> But I really recommend against that api.
> It makes both doc and code messy.
> You need a really good reason to not use the obvious
> def __init__(self, parent, param=default):...
> Terry Jan Reedy
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list