[Python-Dev] Re: A syntax for function attributes?

Greg Ewing greg@cosc.canterbury.ac.nz
Fri, 01 Aug 2003 12:26:43 +1200 (NZST)


Paul Moore <pf_moore@yahoo.co.uk>:

> 2. It's possibly *too* flexible. The temptation to define clever hacks
>    may be just a little high. The example of attrs() mentioned above
>    is a good example. It satisfies a real need, it's simple, and it's
>    easy to implement via the [...] syntax. But is it really the best
>    way of handling function attributes?

Perhaps provision could be made for both:

  def spam(self) [classmethod, foo = "blarg"]:
    ...

> 1. It doesn't help with properties. To be honest, I don't see this as
>    much of an issue, as properties are a very different beast

I agree. We should *not* try to shoehorn properties into the
function modifier syntax, as the resulting contortions would
be at least as bad as what we have now, and probably worse!

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+