Skip to content

Commit a44e540

Browse files
authored
doc: update use in Python
1 parent 7ee5ce5 commit a44e540

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

chapter03_decorator/readme.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
> **Decorator**: Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative
44
> to subclassing for extending functionality.
55
6-
Not quite the same as
7-
python [decorator syntax](https://docs.python.org/3/reference/compound_stmts.html#grammar-token-decorators)
8-
as in python you call the _decorated function_ and the decorating function
9-
is called first whereas the _decorating function_ must be called here.
10-
116
I subclass `ABC` and used the `@abstractmethod` decorator from the
127
`abc` module here but do not use any of this functionality -
138
it just serves as documentation.
149

10+
## Use in Python
11+
12+
The python [decorator syntax](https://docs.python.org/3/reference/compound_stmts.html#grammar-token-decorators)
13+
decorator syntax looks quite different as in python you call the _decorated function_ and the decorating function
14+
is automatically called first whereas the _decorating function_ must be called according to the pattern in the book.
15+
1516
## Running the code
1617

1718
```bash

0 commit comments

Comments
 (0)