[Python-Dev] Re: Re: 2.4a2, and @decorators

Terry Reedy tjreedy at udel.edu
Wed Aug 4 20:40:08 CEST 2004


"Jim Fulton" <jim at zope.com> wrote in message
news:4110E8CF.6070900 at zope.com...
> Terry Reedy wrote:
>  > An advantage of the
> > @ syntax is than it makes the complexiity separable and ignorable for
> > someone learning/teaching basic Python,
>
> I don't agree that they are ignorable.

Any advanced feature is ignorable is the context I specified -- 
learning/teaching basic Python.

>  People will see them in code  and will *have* to understand what they
mean.

Any ignored feature becomes unignorable when one stumbles across it in
'wild' Python and want to really understand.  And even with an
understanding of the general feature, specific knowledge may also be
required -- of the particular module or objects imported or in this case,
the particular decorator.

But there is currently *lots* of publicly available code without decorators
to read, and more will be written.  In addition, one will be able to use at
least some modules that use them without knowing about them, just as with
metaclasses, for instance.

My particular point was separability.  With @, one will still be able to
learn everything about [] and def without hearing the word decorator, and
without having to revise one's understanding upon encountering decorators.
This was not true of the [deco] and deco within def syntax proposals.  It
is a minor point, but one that is a plus for me.

Terry J. Reedy





More information about the Python-Dev mailing list