Re: [Twisted-Python] Code question - semantic meaning of IServiceCollection(parent, parent)

2014-05-26 Thread Jonas Brunsgaard
Thanks Dustin, I got it ;) On Mon, May 26, 2014 at 2:57 PM, Dustin J. Mitchell 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 pr

Re: [Twisted-Python] Importing reactor changes PATHs?

2014-05-26 Thread Michael Schlenker
Am 26.05.2014 16:12, schrieb Merovingian: > Hello, > > Python 2.7.5 32 bit on Windows. > Twisted 13.2.0 > > import ctypes > dll = ctypes.CDLL("ssleay32.dll") > > Loads dll from the current folder > > import ctypes > from twisted.internet import reactor > dll = ctypes.CDLL("s

[Twisted-Python] Importing reactor changes PATHs?

2014-05-26 Thread Merovingian
Hello, Python 2.7.5 32 bit on Windows. Twisted 13.2.0 import ctypes dll = ctypes.CDLL("ssleay32.dll") Loads dll from the current folder import ctypes from twisted.internet import reactor dll = ctypes.CDLL("ssleay32.dll") Loads dll from Python27\lib\site-packages\OpenSSL Ho

Re: [Twisted-Python] Code question - semantic meaning of IServiceCollection(parent, parent)

2014-05-26 Thread Dustin J. Mitchell
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

[Twisted-Python] Code question - semantic meaning of IServiceCollection(parent, parent)

2014-05-26 Thread Jonas Brunsgaard
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.pa