[Python-Dev] Re: PEP 318: Decorators last before colon

Russell E. Owen rowen at cesmail.net
Fri Apr 2 16:01:03 EST 2004


In article <20040402105535.0526c27d.casey at zope.com>,
 Casey Duncan <casey at zope.com> wrote:

> Or how about as?
> 
>   as classmethod:
> 
>      def jinkies(cls):
>          pass
> 
> Which seems nice in the face of other declarations:
> 
>   as protected(some_permission):
> 
>      def zoinks(self, scooby, snack):
>          pass
> 
>      def jinkies(self):
>          pass
> 
> or
> 
>   [protected_by(some_permission)]:
> 
>       def dangerous(self, risk):
>           pass

I like this a lot. The effort to avoid new keywords, though laudable in 
many ways, comes at the cost of increased use of punctuation.

I generally find punctuation harder to read than keywords. Also, it is 
usually incomprehensible to someone unfamiliar with the language. The 
relative lack of punctuation in python as compared, say, to C is one if 
its great strengths, to my mind. It is one reason Python reads so much 
like pseudocode (or did before some of the recent changes such as list 
comprehensions -- very useful but a classic example of the problem of 
overloading punctuation).

I'd be very sad to see [] used for yet some other purpose.

-- Russell




More information about the Python-Dev mailing list