Unification of Methods and Functions

Antoon Pardon apardon at forel.vub.ac.be
Tue May 25 05:46:46 EDT 2004


Op 2004-05-24, David MacQuigg schreef <dmq at gain.com>:
> On Mon, 24 May 2004 14:39:11 +1200, Greg Ewing
><greg at cosc.canterbury.ac.nz> wrote:
>
>>David MacQuigg wrote:
>>
>>> Nobody seems to understand that lambda functions, static methods, etc.
>>> are clutter.
>>
>>On the contrary, lambda has long been regarded as a wart
>>for various reasons. The best way to fix it is probably
>>to just drop it altogether. Nothing essential would be
>>lost.
>
> If "lambda functions" were nothing but functions with the name left
> off, they would serve their current purpose, and they would not be
> such a problem that there is talk of actually taking them *out* of the
> language.  They aren't essential, but they do serve a purpose which
> some feel is important.

The only "importance" is that you are not obligated to write
down a proper function definition when you only want to
provide an expression as a function argument.

>>We don't see static methods as clutter, because for the
>>most part we don't see them (i.e. we don't normally use
>>them). It would be no great loss if they were dropped,
>>too.
>
> I would see it as a loss.  The next best alternative is to move the
> static method outside of the class, and that puts an arbitrary
> restriction on how I can structure my programs.  If the person writing
> the program feels that the function belongs in the class, let's not
> say it can't be done because either a) The syntax doesn't allow it. or
> b) We assume he is wrong in thinking his function belongs inside his
> class.
>
> My perspective may be different, because I have not yet absorbed the
> Python traditions, and I don't have any instictive avoidance of static
> methods.

I never felt the need for static methods, and I still don't think
of my self as having absorbed the python traditions. Maybe the
questions is, where do you get your instinct from to use static
methods?

-- 
Antoon Pardon



More information about the Python-list mailing list