Skip to content

Commit 2dd87be

Browse files
committed
Fix minor spelling, grammar, and consistency errors in the Decorators section.
1 parent cca9272 commit 2dd87be

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/writing/structure.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,12 @@ relatively long life of their own in the computer's memory.
253253
Decorators
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'.
257257
A decorator is a function or a class that wraps (or decorate) a function
258258
or 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
260260
in 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
282282
with decoration is memoization or caching: you want to store the results of an
283283
expensive function in a table and use them directly instead of recomputing
284284
them when they have already been computed. This is clearly not part

0 commit comments

Comments
 (0)