[Python-Dev] Re: Decorators: vertical bar syntax
Andrew McGregor
andrew at indranet.co.nz
Tue Aug 10 23:30:42 CEST 2004
--On Sunday, 8 August 2004 2:16 p.m. +0400 Roman Suzi <rnd at onego.ru> wrote:
> I just anted to rewrite those "real-life-looking" examples with my
> proposed '%' syntax:
>
> def foo() % (classmethod, accepts(int,int), returns(float),):
>
> or formatted:
>
> def foo() % (
> classmethod,
> accepts(int,int),
> returns(float),):
>
> Or it can be done the this way:
>
> def foo():
> ...
>
> foo %= (classmethod, accepts(int,int), returns(float),)
>
> The operation could be called "decorative apply", if the LHS
> has __call__ attribute. Just a new form of % operation with
> special syntax for "def" operator.
(unlurking for a moment...)
Now that actually looks like Python! Great suggestion.
---------
Andrew McGregor
Director, Scientific Advisor
IndraNet Technologies Ltd
http://www.indranet-technologies.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GS/E/B/PA/SS d+(++) s+:+ a C++$ ULS++++ !P+++(---)$ L++++$ E++ W++ !N
w(+++) !O() M++ V--() Y+$ PGP+ t- !5? X- !R !tv@ b++(++++) DI++ D+++@ G
e+++ h(*)@ r%
------END GEEK CODE BLOCK------
More information about the Python-Dev
mailing list