summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2021-04-03 09:58:43 +0200
committerMichele Simionato <michele.simionato@gmail.com>2021-04-03 09:58:43 +0200
commitc12ec8557d8834e4c5c7c59b8275f3694ea6039d (patch)
treede0de6f79c4e1de4ec6c59de2818a20cc88d2d6a
parent6bd88b67493f056603def905ee59a11cefaa47b6 (diff)
downloadpython-decorator-git-c12ec8557d8834e4c5c7c59b8275f3694ea6039d.tar.gz
Markdown fix5.0.4
-rw-r--r--docs/documentation.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/documentation.md b/docs/documentation.md
index ecd7a79..1baa757 100644
--- a/docs/documentation.md
+++ b/docs/documentation.md
@@ -1481,22 +1481,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: