summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2019-04-23 14:40:21 +0200
committerGitHub <noreply@github.com>2019-04-23 14:40:21 +0200
commit7495513ee24deffbf5060860eb69b224fe1d0fe4 (patch)
treea71b394ceda50bcd54c3a8449f418c7b930c472d
parent61e53a4c905213a28d29fd6c2f0f467d23bf9702 (diff)
parent8ddf992183ac605f49929b7781dbc2540c38eb13 (diff)
downloadpython-decorator-git-7495513ee24deffbf5060860eb69b224fe1d0fe4.tar.gz
Merge pull request #66 from pmav99/master
docs: Create ba decorator
-rw-r--r--docs/documentation.md6
-rw-r--r--src/tests/documentation.py2
2 files changed, 6 insertions, 2 deletions
diff --git a/docs/documentation.md b/docs/documentation.md
index d72c6b3..82f642d 100644
--- a/docs/documentation.md
+++ b/docs/documentation.md
@@ -709,11 +709,13 @@ In Python 3.2, ``GeneratorContextManager`` objects were enhanced with
a ``__call__`` method, so that they can be used as decorators, like so:
```python
->>> @ba
+>>> ba = before_after('BEFORE', 'AFTER')
+>>>
+>>> @ba
... def hello():
... print('hello')
...
->>> hello()
+>>> hello()
BEFORE
hello
AFTER
diff --git a/src/tests/documentation.py b/src/tests/documentation.py
index 56c0e19..6a77614 100644
--- a/src/tests/documentation.py
+++ b/src/tests/documentation.py
@@ -547,6 +547,8 @@ In Python 3.2, ``GeneratorContextManager`` objects were enhanced with
a ``__call__`` method, so that they can be used as decorators, like so:
```python
+>>> ba = before_after('BEFORE', 'AFTER')
+>>>
>>> @ba # doctest: +SKIP
... def hello():
... print('hello')