summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2021-04-03 09:57:28 +0200
committerMichele Simionato <michele.simionato@gmail.com>2021-04-03 09:57:28 +0200
commit6bd88b67493f056603def905ee59a11cefaa47b6 (patch)
tree2941930ddac0b26118e48805400cbfd19d9b6be8
parente6e3855c47e3b86054b4640a828b66a837134fc5 (diff)
downloadpython-decorator-git-6bd88b67493f056603def905ee59a11cefaa47b6.tar.gz
Markdown fix
-rw-r--r--src/tests/documentation.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tests/documentation.py b/src/tests/documentation.py
index e34040b..67bb44a 100644
--- a/src/tests/documentation.py
+++ b/src/tests/documentation.py
@@ -1119,22 +1119,28 @@ In previous versions of the decorator module
the caller, with an empty ``kwargs`` dictionary. In version 5.X instead
even ``args`` is empty:
+```python
>>> printsum()
() {}
3
+```
``args`` become non-empty only if you pass the arguments as positional
+```python
>>> printsum(1)
(1,) {}
3
+```
and not if you pass them as keyword arguments:
+```python
>>> printsum(x=1)
() {'x': 1}
3
+```
This can be pretty confusing since non-keyword arguments are passed as
keywork arguments, but it the way it works with ``functools.wraps`` and
the way many people expect it to work: