Browse wiki
This entry published by the Free Software Foundation.
| Decorator |
| Computer languages | Python + |
|---|---|
| Documentation note | See Homepage. |
| Full description | Python decorators are an interesting examp … Python decorators are an interesting example of why syntactic sugar matters. In principle, their introduction in Python 2.4 changed nothing, since they do not provide any new functionality which was not already present in the language. In practice, their introduction has significantly changed the way we structure our programs in Python. I believe the change is for the best, and that decorators are a great idea since: * decorators help reducing boilerplate code; * decorators help separation of concerns; * decorators enhance readability and maintenability; * decorators are explicit. * Still, as of now, writing custom decorators correctly requires some experience and it is not as easy as it could be. For instance, typical implementations of decorators involve nested functions, and we all know that flat is better than nested. The aim of the decorator module it to simplify the usage of decorators for the average programmer, and to popularize decorators by showing various non-trivial examples. Of course, as all techniques, decorators can be abused (I have seen that) and you should not try to solve every problem with a decorator, just because you can. em with a decorator, just because you can. |
| Homepage URL | http://pypi.python.org/pypi/decorator/3.0.1 + |
| Interface | command-line + |
| Is GNU | false + |
| Keywords | code + , Python + , module + , modules + , nested + , decorator + , decorators + |
| Last review by | Kelly Hopkins + |
| Last review date | 10 August 2009 + |
| License | Python + |
| License verified by | Kelly Hopkins + |
| License verified date | 10 August 2009 + |
| Name | Decorator + |
| Programming-language | python + |
| Real name | Michele Simionato + |
| Revisionid | 686 + |
| Revisiontimestamp | 12 April 2011 12:31:48 + |
| Revisionuser | WikiSysop + |
| Role | Maintainer + |
| Short description | Better living through Python with decorators. + |
| Software-development | programming-language + |
| Submitted by | Database conversion + |
| Submitted date | 1 April 2011 + |
| Use | software-development + |
| User level | intermediate + |
| Version date | 16 February 2009 + |
| Version download | http://pypi.python.org/packages/source/d/decorator/decorator-3.0.1.tar.gz#md5=c4130a467be7f71154976c84af4a04c6 + |
| Version identifier | 3.0.1 + |
| Version status | stable + |
| Modification dateThis property is a special property in this wiki. | 24 May 2012 22:39:17 + |
| Page has default formThis property is a special property in this wiki. | Entry + |
| EmailThis property is a special property in this wiki. | michele.simionato@gmail.com + |
| hide properties that link here |
| Decorator#2 + | License of |
|---|---|
| Decorator#1 + | Person of |
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the page “GNU Free Documentation License”.
The copyright and license notices on this page only apply to the text on this page. Any software described in this text has its own copyright notice and license, which can usually be found in the distribution itself.
