parameterized functions: a question of style
peter at engcorp.com
Tue Aug 13 02:30:18 CEST 2002
> Peter Hansen wrote:
> > Blair Hall wrote:
> >>This solution leaves me with a class, not a function (which is what I
> >>intended to have), so there would be a further step needed to export
> >>the class methods as functions.
> > The further step would simply be to define __call__() methods in the
> > classes to make the instances callable. Then you have "functions"
> > in the sense that you probably need them.
> > -Peter
> *simply* ?
Well, it is actually quite simple, as the small next step needed to turn
his classes into what he needed.
> I'd say the first solution (FP style) is much more simple and readable,
> and so much more pythonic...
I agree completely. I was not recommending the approach, just answering
his implied question about how to get it to work.
More information about the Python-list