[Python-Dev] Re: decorators and 2.4
barry at python.org
Mon Jun 28 14:34:27 EDT 2004
On Mon, 2004-06-28 at 14:06, Jeff Bone wrote:
> Granted. But let's look at the above. Now, you're intimately familiar
> with the current implementation of txnprop, so you think of the above
> in terms of its literal side-effecting behavior. But looking at it as
> a consumer of the interface --- simply as a user reading the code, or
> as some automated tool which doesn't understand and doesn't necessarily
> NEED to understand the effect of txnprop, that looks awfully
> declarative --- doesn't it? You're in essence saying "the following is
> a transactional function."
Which is why early on, I favored decorator-after-def syntax, like so:
def [txnprop] create_list(self, listid):
because it read more English-like: "Define a txnprop called create_list
with arguments self and listid". But I'm definitely not going to give
that poor deceased equine even one more whack.
> So on closer examination it looks like this application can still be
> given purely declarative semantics from the API consumer's perspective.
> That's not going to screw up e.g. typing --- particularly not if e.g.
> the implementation of txnprop is further decorated to indicate what
> exceptions are thrown, etc. It doesn't so much *modify* the behavior
> of create_list from the API consumer's (human or otherwise) perspective
> as it does *declare* what it is.
Perhaps, but I haven't followed this thread close enough to know what
point you want to make. For me, I want the feature with semantics that
are described in the PEP, which are basically equivalent to what the
explicit wrappers can do in Python today. I think there's fairly
widespread agreement on the semantics, and the only questions open are
which syntax Guido will chose, and what version of Python he'll want to
add this to. Given the contenders still standing, I don't care about
the former, but I want the latter to be "Python 2.4".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20040628/f2c9148e/attachment-0001.bin
More information about the Python-Dev