<div dir="ltr">Thanks Dustin, I got it ;)<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 26, 2014 at 2:57 PM, Dustin J. Mitchell <span dir="ltr"><<a href="mailto:dustin@v.igoro.us" target="_blank">dustin@v.igoro.us</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It's certainly not an obvious syntax, but it "casts" the first<br>
argument into a provider of the interface, defaulting to the second<br>
argument if this is not possible.<br>
<br>
For example, if `parent` isn't a provider of `IServiceCollection`, but<br>
there's an adapter registered to covert to `IServiceCollection` from<br>
`type(parent)`, then that adapter will be called.  If there's no such<br>
adapter, the cast will return `parent`.<br>
<br>
Dustin<br>
<div><div class="h5"><br>
On Mon, May 26, 2014 at 8:27 AM, Jonas Brunsgaard<br>
<<a href="mailto:jonas.brunsgaard@gmail.com">jonas.brunsgaard@gmail.com</a>> wrote:<br>
> Hello all<br>
><br>
> Will someone explain to me what happens when you call an Interface with<br>
> arguments, and why the same argument twice?<br>
><br>
><br>
><br>
> My problem is to understand the semantics of the line<br>
><br>
>     parent = IServiceCollection(parent, parent)<br>
><br>
><br>
><br>
> part of<br>
><br>
>     def setServiceParent(self, parent):<br>
><br>
>         if self.parent is not None:<br>
><br>
>             self.disownServiceParent()<br>
>         parent = IServiceCollection(parent, parent)<br>
><br>
>         self.parent = parent<br>
>         self.parent.addService(self)<br>
><br>
><br>
><br>
> in twisted.application.service<br>
><br>
> Thanks in advance.<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Twisted-Python mailing list<br>
> <a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
> <a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
><br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote></div><br></div>