Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-25 Thread Nick Coghlan
On Fri, Mar 25, 2011 at 11:29 PM, Antoine Pitrou wrote: >> My model for the suggestion is the context objects in the decimal >> module. They offer a constrained way to affect the way the entire >> decimal module goes about its business, and through judicious use of >> thread local storage and cont

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-25 Thread Antoine Pitrou
On Fri, 25 Mar 2011 21:10:08 +1000 Nick Coghlan wrote: > On Fri, Mar 25, 2011 at 12:22 PM, Glenn Linderman > wrote: > > On 3/24/2011 4:25 PM, Nick Coghlan wrote: > > > > As an example of the last point, perhaps rather than modifying all the > > *clients* of the socket module, it may make more se

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-25 Thread Nick Coghlan
On Fri, Mar 25, 2011 at 12:22 PM, Glenn Linderman wrote: > On 3/24/2011 4:25 PM, Nick Coghlan 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 custom

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-25 Thread Xavier Morel
On 2011-03-25, at 10:22 , Simon Cross wrote: > On Fri, Mar 25, 2011 at 1:25 AM, Nick Coghlan 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 custom

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-25 Thread Nick Coghlan
On Fri, Mar 25, 2011 at 7:22 PM, Simon Cross wrote: > On Fri, Mar 25, 2011 at 1:25 AM, Nick Coghlan 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 temporaril

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-25 Thread Simon Cross
On Fri, Mar 25, 2011 at 1:25 AM, Nick Coghlan 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 t

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-24 Thread Glenn Linderman
On 3/24/2011 4:25 PM, Nick Coghlan 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 advant

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-24 Thread Eugene Toder
> 2. The level at which the dependency injection works (function > arguments, class attributes, module globals) needs to be decided +1. The scope of parameter needs to be specified. If the scope is global, this can be achieved pretty easily -- declare some of the imports in particular modules to b

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-24 Thread Nick Coghlan
On Fri, Mar 25, 2011 at 2:40 AM, Jesus Cea wrote: > What do you think?. Should I write a PEP? (I don't think so, but your > opinion matters). I care, for instance, about how to garantee the API > coverage actually needed for the new "socket-like" object. The idea is > that your object should be "s

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-24 Thread Michael Foord
On 24/03/2011 17:46, Andrew McNabb wrote: On Thu, Mar 24, 2011 at 10:12:18AM -0700, Guido van Rossum wrote: On Thu, Mar 24, 2011 at 9:46 AM, Benjamin Peterson wrote: I want to test the dev community interest in modifying the stdlib to ease dependence injection. I, for one, am -1. Code shouldn

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-24 Thread Andrew McNabb
On Thu, Mar 24, 2011 at 10:12:18AM -0700, Guido van Rossum wrote: > On Thu, Mar 24, 2011 at 9:46 AM, Benjamin Peterson > wrote: > >> I want to test the dev community interest in modifying the stdlib to > >> ease dependence injection. > > > > I, for one, am -1. Code shouldn't be uglified for the p

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-24 Thread Guido van Rossum
On Thu, Mar 24, 2011 at 9:46 AM, Benjamin Peterson wrote: >> I want to test the dev community interest in modifying the stdlib to >> ease dependence injection. > > I, for one, am -1. Code shouldn't be uglified for the purposes of > testing. Well, the philosophy of dependency injection requires ex

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-24 Thread Antoine Pitrou
On Thu, 24 Mar 2011 11:46:42 -0500 Benjamin Peterson wrote: > 2011/3/24 Jesus Cea : > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > Hi, everybody. > > > > I want to test the dev community interest in modifying the stdlib to > > ease dependence injection. > > I, for one, am -1. Code

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-24 Thread James Y Knight
On Mar 24, 2011, at 12:40 PM, Jesus Cea wrote: > I want to test the dev community interest in modifying the stdlib to > ease dependence injection. > > The seminal idea was in > . > > A lot of stdlib modules use, deep inside, othe

Re: [Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-24 Thread Benjamin Peterson
2011/3/24 Jesus Cea : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, everybody. > > I want to test the dev community interest in modifying the stdlib to > ease dependence injection. I, for one, am -1. Code shouldn't be uglified for the purposes of testing. It's also a slippery slope. Ma

[Python-Dev] Proposal for Python 3.3: dependence injection

2011-03-24 Thread Jesus Cea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, everybody. I want to test the dev community interest in modifying the stdlib to ease dependence injection. The seminal idea was in . A lot of stdlib modules use, deep inside, ot