File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ decorators can make your code concise.
99
1010Firstly let's discuss how to write your own decorator.
1111
12- It is perhaps one of the most difficult concept to grasp. We will take
13- it one step at a time so that you can fully inderstand it.
12+ It is perhaps one of the most difficult concepts to grasp. We will take
13+ it one step at a time so that you can fully understand it.
1414
1515Everything in python is an object:
1616^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -205,9 +205,9 @@ Python. Now there is one problem with our code. If we run:
205205 print(a_function_requiring_decoration.__name__)
206206 # Output: wrapTheFunction
207207
208- That's not what we expected! It's name is
208+ That's not what we expected! Its name is
209209"a\_ function\_ requiring\_ decoration". Well our function was replaced by
210- wrapTheFunction. It overrided the name and docstring of our function.
210+ wrapTheFunction. It overrode the name and docstring of our function.
211211Luckily Python provides us a simple function to solve this problem and
212212that is ``functools.wraps ``. Let's modify our previous example to use
213213``functools.wraps ``:
You can’t perform that action at this time.
0 commit comments