Re: Best place for a function?

2007-03-13 Thread Inyeol Lee
On Sun, Mar 11, 2007 at 06:36:02PM +0100, Bruno Desthuilliers wrote: > Inyeol Lee a �crit : > > On Wed, Mar 07, 2007 at 05:27:04PM -0500, Sergio Correia wrote: > > > >>I'm writing a class, where one of the methods is kinda complex. The > >>method uses a function which I know for certain will not b

Re: Best place for a function?

2007-03-11 Thread Bruno Desthuilliers
Inyeol Lee a écrit : > On Wed, Mar 07, 2007 at 05:27:04PM -0500, Sergio Correia wrote: > >>I'm writing a class, where one of the methods is kinda complex. The >>method uses a function which I know for certain will not be used >>anywhere else. This function does not require anything from self, only

Re: Best place for a function?

2007-03-09 Thread Inyeol Lee
On Wed, Mar 07, 2007 at 05:27:04PM -0500, Sergio Correia wrote: > I'm writing a class, where one of the methods is kinda complex. The > method uses a function which I know for certain will not be used > anywhere else. This function does not require anything from self, only > the args passed by the

Re: Best place for a function?

2007-03-07 Thread Sergio Correia
I also found out I can't use `unittest` with nested functions :-( Thank you all for the responses, Best, Sergio On 7 Mar 2007 14:57:54 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch: > > If it really has no other use as in this class, put it as an > > instancemethod in th

Re: Best place for a function?

2007-03-07 Thread bearophileHUGS
Diez B. Roggisch: > If it really has no other use as in this class, put it as an > instancemethod in there. Alternatively, you _could_ nest it like this: Using an instancemethod may be the most formally correct solution for that problem, but often nested function are the simpler solution. A downsi

Re: Best place for a function?

2007-03-07 Thread Bruno Desthuilliers
Sergio Correia a écrit : > I'm writing a class, where one of the methods is kinda complex. The > method uses a function which I know for certain will not be used > anywhere else. This function does not require anything from self, only > the args passed by the method. > > Where should I put the fun

Re: Best place for a function?

2007-03-07 Thread Diez B. Roggisch
Sergio Correia schrieb: > I'm writing a class, where one of the methods is kinda complex. The > method uses a function which I know for certain will not be used > anywhere else. This function does not require anything from self, only > the args passed by the method. > > Where should I put the func

Best place for a function?

2007-03-07 Thread Sergio Correia
I'm writing a class, where one of the methods is kinda complex. The method uses a function which I know for certain will not be used anywhere else. This function does not require anything from self, only the args passed by the method. Where should I put the function? a) Inside the module but outs