Thanks Dustin, I got it ;)
On Mon, May 26, 2014 at 2:57 PM, Dustin J. Mitchell <[email protected]>wrote: > It's certainly not an obvious syntax, but it "casts" the first > argument into a provider of the interface, defaulting to the second > argument if this is not possible. > > For example, if `parent` isn't a provider of `IServiceCollection`, but > there's an adapter registered to covert to `IServiceCollection` from > `type(parent)`, then that adapter will be called. If there's no such > adapter, the cast will return `parent`. > > Dustin > > On Mon, May 26, 2014 at 8:27 AM, Jonas Brunsgaard > <[email protected]> wrote: > > Hello all > > > > Will someone explain to me what happens when you call an Interface with > > arguments, and why the same argument twice? > > > > > > > > My problem is to understand the semantics of the line > > > > parent = IServiceCollection(parent, parent) > > > > > > > > part of > > > > def setServiceParent(self, parent): > > > > if self.parent is not None: > > > > self.disownServiceParent() > > parent = IServiceCollection(parent, parent) > > > > self.parent = parent > > self.parent.addService(self) > > > > > > > > in twisted.application.service > > > > Thanks in advance. > > > > > > _______________________________________________ > > Twisted-Python mailing list > > [email protected] > > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python > > > > _______________________________________________ > Twisted-Python mailing list > [email protected] > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python >
_______________________________________________ Twisted-Python mailing list [email protected] http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
