Decorator keyword options

Michael Sparks michaels at rd.bbc.co.uk
Fri Aug 20 10:10:06 EDT 2004


Paul McGuire wrote:
> Please visit the PythonDecorators Wiki
> page, and navigate to section 6.1 Indicators (or follow this link
>
http://www.python.org/moin/PythonDecorators#head-61f608dbce6ba75b2317d7825d8529997f56fc9e
> )
> (not sure how reliable this is?)  I have started numbering the options
> in preparation for another voting thread, if you have other proposals,
> please include them on this Wiki page, along with your +/0/-
> commentary.

A couple of comments I'd personally make...
   * If you look at longer lists of decorators, what strikes me
     personally is that any format is declaring properties of the
     function that follows.
 
   * It's worth considering is ability for people to search effectively
     for what a piece of syntax means, especially if it's something not
     likely to be heavily used by code. (Consider what happens if you
     google for the phrase: to be or not to be)

     For example would "properties" (not listed as an option) give any
     indication that the function is being changed? "decorate" to a
     greater extent does. "modifiers" or "decorators" (call a spade a
     spade?) might be clearer, is just a noun.

A very useful way of dividing up decorators was posted a week or so
back, which formed the structure of section 6. Personally I think
something similar might be useful here:

   * Use noun or verb
      * If noun, singular or plural? (Sheep excepted)
      * If verb, active or passive
   * Hint at properties or actions
   * Whether to link with the def or not.

"decorate" falls into the verb, passive, action category I think.
"modifiers" falls into the noun, plural, property category I think.
"using" would fall into verb, active, action, linked category

Personally I think noun, plural, property is a non-starter for most
situations (eg classmethod, staticmethod). There's probably similar
examples that work well.

Regards,


Michael.
-- 
Michael.Sparks at rd.bbc.co.uk    
British Broadcasting Corporation, Research and Development
Kingswood Warren, Surrey KT20 6NP

This message (and any attachments) may contain personal views
which are not the views of the BBC unless specifically stated.





More information about the Python-list mailing list