diff options
author | Michele Simionato <michele.simionato@gmail.com> | 2018-04-15 15:07:17 +0200 |
---|---|---|
committer | Michele Simionato <michele.simionato@gmail.com> | 2018-04-15 15:07:17 +0200 |
commit | e26c05d7a6ed19424526d5031a9883ad72cf58bb (patch) | |
tree | dcdbce04bedb29a0ccaaa8411e5a4125f1789464 | |
parent | 19a06ef38d8caf369a734909191b810fb7be972c (diff) | |
download | python-decorator-git-e26c05d7a6ed19424526d5031a9883ad72cf58bb.tar.gz |
Fixed docs [skip CI]
-rw-r--r-- | src/tests/documentation.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/tests/documentation.py b/src/tests/documentation.py index b54a3f3..b496660 100644 --- a/src/tests/documentation.py +++ b/src/tests/documentation.py @@ -371,7 +371,7 @@ like this: return decorator(caller) This is fully general but requires an additional level of nesting. For this -reasone since version 4.2 there is a facility to build +reason since version 4.2 there is a facility to build decorator factories by using a single caller with default arguments i.e. writing something like this: @@ -385,7 +385,7 @@ Notice that this simplified approach *only works with default arguments*, i.e. `param1`, `param2` etc must have known defaults. Thanks to this restriction, there exists an unique default decorator, i.e. the member of the family which uses the default values for all parameters. Such -decorator can be written as `decfactory()` with no parameters specified; +decorator can be written as ``decfactory()`` with no parameters specified; moreover, as a shortcut, it is also possible to elide the parenthesis, a feature much requested by the users. For years I have been opposite to this feature request, since having expliciti parenthesis to me is more clear @@ -441,17 +441,6 @@ where ``restricted`` is a decorator factory defined as follows $$restricted -In general a decorator factory has a signature - -.. code-block:: python - - def decfactory(func, par1=default1, .., parN=defaultN, *a, **k): - ... - -Each parameter must have a default, so that ``decfactory`` can work -as an alias for ``decfactory()``, i.e. the decorator in which all parameters -have the default value. - ``decorator(cls)`` -------------------------------------------- |