Best place for a function?

Sergio Correia sergio.correia at
Thu Mar 8 00:20:29 CET 2007

I also found out I can't use `unittest` with nested functions :-(

Thank you all for the responses,


On 7 Mar 2007 14:57:54 -0800, bearophileHUGS at
<bearophileHUGS at> wrote:
> 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
> downside of nested functions is that you can't give them a doctest (in
> a simple way).
> Bye,
> bearophile
> --

More information about the Python-list mailing list