Difference between revisions of "Decorator"

From Free Software Directory
Jump to: navigation, search
(Created page with "{{Entry |Name=Decorator |Short description=Better living through Python with decorators. |Full description=Python decorators are an interesting example of why syntactic sugar mat...")
 
(Added Python and Ruby link)
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:
 
* decorators are explicit.
 
* 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.
 
* 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.
 +
|Homepage URL=https://pypi.python.org/pypi/decorator
 
|User level=intermediate
 
|User level=intermediate
|Status=Live
+
|Is High Priority Project=No
|Component programs=
 
|Homepage URL=http://pypi.python.org/pypi/decorator/3.0.1
 
|VCS checkout command=
 
 
|Computer languages=Python
 
|Computer languages=Python
 
|Documentation note=See Homepage.
 
|Documentation note=See Homepage.
|Paid support=
+
|Accepts cryptocurrency donations=No
|IRC help=
 
|IRC general=
 
|IRC development=
 
|Related projects=
 
 
|Keywords=code,Python,module,modules,nested,decorator,decorators
 
|Keywords=code,Python,module,modules,nested,decorator,decorators
|Is GNU=n
+
|Version identifier=4.0.11
|Last review by=Kelly Hopkins
+
|Version date=2017/01/15
|Last review date=2009-08-10
+
|Version status=stable
 +
|Version download=https://pypi.python.org/packages/cc/ac/5a16f1fc0506ff72fcc8fd4e858e3a1c231f224ab79bb7c4c9b2094cc570/decorator-4.0.11.tar.gz#md5=73644c8f0bd4983d1b6a34b49adec0ae
 +
|Last review by=Bendikker
 +
|Last review date=2018/03/29
 
|Submitted by=Database conversion
 
|Submitted by=Database conversion
 
|Submitted date=2011-04-01
 
|Submitted date=2011-04-01
|Version identifier=3.0.1
+
|Is GNU=No
|Version date=2009-02-16
+
|License verified date=2009-08-10
|Version status=stable
+
}}
|Version download=http://pypi.python.org/packages/source/d/decorator/decorator-3.0.1.tar.gz#md5=c4130a467be7f71154976c84af4a04c6
+
{{Project license
 +
|License=Python
 +
|License verified by=Kelly Hopkins
 
|License verified date=2009-08-10
 
|License verified date=2009-08-10
|Version comment=
 
 
}}
 
}}
 
{{Person
 
{{Person
 +
|Real name=Michele Simionato
 
|Role=Maintainer
 
|Role=Maintainer
|Real name=Michele Simionato
 
 
|Email=michele.simionato@gmail.com
 
|Email=michele.simionato@gmail.com
|Resource URL=
+
}}
 +
{{Resource
 +
|Resource audience=Python (Ref)
 +
|Resource URL=https://pypi.org/project/decorator
 +
}}
 +
{{Resource
 +
|Resource audience=Ruby (Ref)
 +
|Resource URL=https://rubygems.org/gems/decorator
 
}}
 
}}
 
{{Software category
 
{{Software category
Line 45: Line 50:
 
|Use=software-development
 
|Use=software-development
 
}}
 
}}
{{Project license
+
{{Featured}}
|License=Python
 
|License verified by=Kelly Hopkins
 
|License verified date=2009-08-10
 
}}
 

Latest revision as of 13:42, 29 March 2018


[edit]

Decorator

https://pypi.python.org/pypi/decorator
Better living through Python with decorators.

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.





Licensing

License

Verified by

Verified on

Notes

License

Python

Verified by

Kelly Hopkins

Verified on

10 August 2009




Leaders and contributors

Contact(s)Role
Michele Simionato Maintainer


Resources and communication

AudienceResource typeURI
Python (Ref)https://pypi.org/project/decorator
Ruby (Ref)https://rubygems.org/gems/decorator


Software prerequisites




Entry










"Python (Ref)" is not in the list (General, Help, Bug Tracking, Support, Developer) of allowed values for the "Resource audience" property.


"Ruby (Ref)" is not in the list (General, Help, Bug Tracking, Support, Developer) of allowed values for the "Resource audience" property.








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 or copyright-licenses or other similar notices described in this text has its own copyright notice and license, which can usually be found in the distribution or license text itself.