Skip to content

Commit c348cdf

Browse files
author
Christopher Harrison
committed
Added decorators readme
1 parent 9f32abf commit c348cdf

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎18 - Decorators/README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Decorators
2+
3+
[Decorators](https://www.python.org/dev/peps/pep-0318/) are similar to attributes in that they add meaning or functionality to blocks of code in Python. They're frequently used in frameworks such as [Flask](http://flask.pocoo.org/) or [Django](https://www.djangoproject.com/). The most common interaction you'll have with decorators as a Python developer is through using them rather than creating them.
4+
5+
``` python
6+
# Example decorator
7+
@log(True)
8+
def sample_function():
9+
print('this is a sample function')
10+
```

0 commit comments

Comments
 (0)