Decorator syntax (was Re: PEP 318 - PyFIT comments)

John Roth newsgroups at jhrothjr.com
Thu Aug 5 03:49:41 CEST 2004


"Bruce Eckel" <BruceEckel at MailBlocks.com> wrote in message
news:mailman.1168.1091667628.5135.python-list at python.org...
> I'll weigh in a little on this one.
>
> This is very similar to attributes/metadata in Java J2SE 5 and in C#.
> The thing is, metadata is a little bit weird; it's intentionally
> outside of the domain of the 'normal' programming language, because it
> expresses things that you can't or shouldn't within the normal
> programming language. So you _do_ need an escape mechanism. And it
> also takes a little bit of getting used to; it's orthogonal to what
> you normally think of as a language feature. But the potential for
> metadata features, at least in Java, is very powerful.

I'd be a lot happier if it was, in fact, a general metadata
facility. Unfortunately, it only seems to work on functions
(methods), and for what I'm working on I need metadata
for properties and fields as well, that is, any identifier that you can
bind an object to.

That's not to say I can't use it for something. It looks like
it might be very useful if I ever get around to writing an
interactive fiction system in Python. It solves one significant
problem in such a system - how to put a method into an
instance cleanly.

John Roth
>
> Bruce Eckel
>
>





More information about the Python-list mailing list