PEP 318: Can't we all just get along?

Arthur ajsiegel at optonline.com
Fri Aug 20 04:43:58 CEST 2004


On Thu, 19 Aug 2004 21:54:07 -0400, Roy Smith <roy at panix.com> wrote:

>In article <mailman.1991.1092960665.5135.python-list at python.org>,
> "Delaney, Timothy C (Timothy)" <tdelaney at avaya.com> wrote:
>
>> Neil Zanella wrote:
>> 
>> > Well, allow me to contribute my thoughts on staticmethod and
>> > classmethod: 
>> > I am barely starting out with Python and my class objects are already
>> > loaded with so many
>> > 
>> > foo = staticmethod(foo)
>> 
>> These two facts could be somewhat related ... ;)
>> 
>> Tim Delaney
>
>I never quite understood the point of static methods inside classes.  
>When would you ever need to do that, as opposed to just a function in a 
>module?  In Java's "everything is part of a class" philosophy, it makes 
>sense, but in Python?

yeah.

Its confusing to me that with consistent reference to the ugliness of:

foo=staticmethod(foo)

I've never heard the explanation of when its true need arises.

But I am afraid in these kinds of discussions it's easy to lose track
of the underlying assumptions on which the discussion rests.

And the basis for the discussions folks choose to have.

what are debating points, what are abstract considerations, what are
aesthetic issues, and what goes to the heart of solving practical
porgramming issues.

It is hard to deny that in a language where the need for static
methods are built-in to the structure of the language, one would want
something more elegant than 

foo=staticmethod(foo)

The fact that this is simply not the case with Python seems to have
been made a minor point, rather than to the heart of the matter.

Hard to understand why.

I am not suspecting that folks who find the need for staticmethod are
making it up out of thin air, or misunderstanding the best solution to
their problem..

But I do suspect that options have been taken away from them by
external factors - as I suspect in the case of PyObjC 70 letter
function names. In other words, its seems that they are boxed in,
somehow. 

And perhaps the effort to accommodate a need that arises in defiance
of the natural flow of the language's structure and elegance, will
necessarily be subversive of its structure and elegance.
  
Or so it seems to me, in this case.


Art




More information about the Python-list mailing list