File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -253,12 +253,12 @@ relatively long life of their own in the computer's memory.
253253Decorators
254254----------
255255
256- Python language provides a simple yet powerful syntax called 'decorators'.
256+ The Python language provides a simple yet powerful syntax called 'decorators'.
257257A decorator is a function or a class that wraps (or decorate) a function
258258or a method. The 'decorated' function or method will replace the original
259- 'undecorated' function or method. Because function are first-class objects
259+ 'undecorated' function or method. Because functions are first-class objects
260260in Python it can be done 'manually' but using the @decorator syntax is
261- clearer and thus prefered .
261+ clearer and thus preferred .
262262
263263.. code-block :: Python
264264
@@ -277,8 +277,8 @@ clearer and thus prefered.
277277 # bar() is decorated
278278
279279 Using this mechanism is useful for separating concerns and avoiding
280- external un-related logic to 'pollute ' the core logic of the function
281- or method. A good example of a functionality that is better handled
280+ external un-related logic 'polluting ' the core logic of the function
281+ or method. A good example of a piece of functionality that is better handled
282282with decoration is memoization or caching: you want to store the results of an
283283expensive function in a table and use them directly instead of recomputing
284284them when they have already been computed. This is clearly not part
You can’t perform that action at this time.
0 commit comments