Decorators (was: Re: I love assert)
oquanox at gmail.com
Sat Nov 15 03:36:41 CET 2014
Decorators were there in Python 2.4, released in 2005. Not exactly new.
On Sat Nov 15 2014 at 7:51:11 AM Richard Riehle <rriehle at itu.edu> wrote:
> On Friday, November 14, 2014 2:18:48 PM UTC-8, Marko Rauhamaa wrote:
> > Richard Riehle <rriehle at itu.edu>:
> > > I find that not a lot of Python user really appreciate the power of
> > > decorators.
> > Well, I don't.
> > All it means is that I've never seen a use of decorators that has
> > enhanced the code. Once I "see the light," I'll have no problem changing
> > my view.
> > Marko
> Decorators are new in Python, so there are not a lot of people using
> them. From my experience with other languages, especially Ada and Eiffel,
> I enjoy the benefit of assertions (as pre-conditions and post-conditions
> and invariants) at the specification level (not embedded in the code), so
> decorators are closer to my other experience. They bring me closer to the
> Design by Contract model of Ada and Eiffel. That is why I was so pleased
> to see them added to Python.
> It is true, however, that they are not immediately intutive in Python, but
> once understood, they are handy IMHO for improving code reliability.
> Perhaps I was spoiled by having this capability in some other languages.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list