Decorator syntax

Mark 'Kamikaze' Hughes kamikaze at kuoi.asui.uidaho.edu
Fri Aug 6 02:29:03 CEST 2004


Istvan Albert <ialbert at mailblocks.com>
wrote on Thu, 05 Aug 2004 16:58:07 -0400:
> Mark 'Kamikaze' Hughes wrote:
>> class foo:
>>     def introduceNewFeature(self, someArgument, anotherArgument): [synchronized, types="o,i,i"]
>>         pass # whatever
> Those who need argument type-checking should
> go to Guido and talk to him about it. Piggybacking
> this in as decorators makes everybody lose.

  They have talked to him about it.  It's been talked to death.  One of
the major groups pushing for decorators are PyObjC users, who need it to
make the interface vaguely tolerable.

  Also consider web services, which need metadata to access Python with
anything but raw strings.  That metadata can be stored in an XML file or
something, but it's best if it's *right there* on the function def.

  This is not an in-Python type-checking mechanism, but a mechanism for
attaching additional information to functions, mostly so they can
interact with things that are not Python.

>> 3) A large proportion of Python programmers are also Java programmers,
>>    and won't object to the @-syntax.
> yay. love is in the air.

  I have no idea what you were trying to say there.

-- 
 <a href="http://kuoi.asui.uidaho.edu/~kamikaze/"> Mark Hughes </a>
"Virtues foster one another; so too, vices.
 Bad English kills trees, consumes energy, and befouls the Earth.
 Good English renews it." -The Underground Grammarian, v1n2



More information about the Python-list mailing list