parameterized functions: a question of style
Peter Hansen
peter at engcorp.com
Mon Aug 12 20:30:18 EDT 2002
laotseu wrote:
>
> 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.
> <AMHA>
> I'd say the first solution (FP style) is much more simple and readable,
> and so much more pythonic...
> </AMHA>
I agree completely. I was not recommending the approach, just answering
his implied question about how to get it to work.
-Peter
More information about the Python-list
mailing list