@decorators

John Roth newsgroups at jhrothjr.com
Fri Aug 6 15:48:26 CEST 2004


"Roy Smith" <roy at panix.com> wrote in message
news:roy-B53A92.08194306082004 at reader1.panix.com...
> A few random comments:
>
>
> I'm also thinking about programming by contract.  It seems like the pre-
> and post-condition assertions could also be thought of as meta-data.
> Some of the examples in the PEP hint at doing this, but don't address
> things contract inheritance.  Has there been any discussion of this?

There are several DBC packages out there. I can't give you any
pointers because I don't do things that way, but I've seen some
rather enthusiastic comments.

All of the existing packages (at least to my knowledge) use
descriptors to wrap the necessary functions. They could be
very easily reimplemented in terms of the decorator syntax.
However, the decorator syntax brings no new functionality
to the table; it's simply syntactic sugar for already existing
functionality.

It may, of course, improve readability, which is always
desirable.

> Lastly, and perhaps most importantly, I'm rather distressed at the tone
> of some of the postings I've seen here over the past couple of days.
> Some of the sentiments I've seen expressed are downright rude,
> combative, and accusatory.  These sorts of things are way out of line.

Likewise.

John Roth





More information about the Python-list mailing list