[Python-Dev] Re: new syntax for wrapping (PEP 318)

Ronald Oussoren oussoren at cistron.nl
Thu Feb 26 14:28:42 EST 2004


On 26-feb-04, at 3:56, Josiah Carlson wrote:

>> Just a data point from a user: I use classmethod fairly frequently, 
>> and
>> I would *love* to see some syntax to support it.  As has been pointed
>> out before, classmethod (and staticmethod) are a part of the interface
>> of a function, and shouldn't be tacked on to the end of the body.
>> Please let me put them where people (and hopefully pydoc and 
>> pychecker)
>> can easily see them.
>
> I personally don't see the point of using any syntax for wrapping a
> function like so:
>
> class a:
>     def funct(self):
>         pass
>     a = classmethod(a)

Not that I have anything usefull to add, but ...

I find the proposed syntax easier to understand than the current 
alternative, even for short functions.

In "def foo(self) [classmethod]: pass" the [classmethod] part feels 
like an anotation/declaration, while "foo = classmethod(foo)" has a 
more magical feel.

I'd expect at least as much newbe questions about the current idiom 
than about the alternatives.

Ronald

--
X|support bv            http://www.xsupport.nl/
T:  +31 610271479       F:  +31 204416173




More information about the Python-Dev mailing list