Skip to content

Commit

Permalink
Merge pull request #101 from bngsudheer/master
Browse files Browse the repository at this point in the history
Capitalize Python. Minor grammar fixes
  • Loading branch information
yasoob committed Mar 23, 2016
2 parents 6119d19 + 861387d commit 2f9c287
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions decorators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ First, let's discuss how to write your own decorator.
It is perhaps one of the most difficult concepts to grasp. We will take
it one step at a time so that you can fully understand it.

Everything in python is an object:
Everything in Python is an object:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

First of all let's understand functions in python:
First of all let's understand functions in Python:

.. code:: python
Expand Down Expand Up @@ -170,12 +170,12 @@ previous decorator and make a little bit more usable program:
#now a_function_requiring_decoration is wrapped by wrapTheFunction()
a_function_requiring_decoration()
#outputs:I am doing some boring work before executing a_function_requiring_decoration()
#outputs:I am doing some boring work before executing a_func()
# I am the function which needs some decoration to remove my foul smell
# I am doing some boring work after executing a_function_requiring_decoration()
# I am doing some boring work after executing a_func()
Did you get it? We just applied the previously learned principles. This
is exactly what the decorators do in python! They wrap a function and
is exactly what the decorators do in Python! They wrap a function and
modify its behaviour in one way or the another. Now you might be
wondering that we did not use the @ anywhere in our code? That is just a
short way of making up a decorated function. Here is how we could have
Expand Down

0 comments on commit 2f9c287

Please sign in to comment.