[Python-Dev] Proposal for Python 3.3: dependence injection
Nick Coghlan
ncoghlan at gmail.com
Fri Mar 25 12:04:17 CET 2011
On Fri, Mar 25, 2011 at 7:22 PM, Simon Cross
<hodgestar+pythondev at gmail.com> wrote:
> On Fri, Mar 25, 2011 at 1:25 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> As an example of the last point, perhaps rather than modifying all the
>> *clients* of the socket module, it may make more sense to have tools
>> in the socket module itself to temporarily customise the socket
>> creation process in the current thread. The advantage of such an
>> approach is that it would then work for 3rd party libraries that
>> create sockets, without requiring any further modification.
>
> -2. That wouldn't allow one to use normal sockets in one 3rd party
> library and special sockets in another 3rd party library.
Uh, yes it would. One possible implementation is to use exactly the
same techniques that are used to implement contexts in the decimal
module.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev
mailing list