Skip to content

Commit ea417e3

Browse files
committed
Merge pull request yasoob#35 from dagrha/master
Rephrased a couple sentences
2 parents 0e089cb + 13155e1 commit ea417e3

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

args_and_kwargs.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Usage of \*args
1313

1414
\*args and \*\*kwargs are mostly used in function definitions. \*args
1515
and \*\*kwargs allow you to pass a variable number of arguments to a
16-
function. What does variable mean here is that you do not know before
17-
hand that how many arguments can be passed to your function by the user
16+
function. What variable means here is that you do not know beforehand
17+
how many arguments can be passed to your function by the user
1818
so in this case you use these two keywords. \*args is used to send a
1919
**non-keyworded** variable length argument list to the function. Here's
2020
an example to help you get a clear idea:
@@ -37,7 +37,7 @@ This produces the following result:
3737
another arg through *argv : eggs
3838
another arg through *argv : test
3939
40-
I hope this cleared away any confusion that you had. So now lets talk
40+
I hope this cleared away any confusion that you had. So now let's talk
4141
about \*\*kwargs
4242

4343
Usage of \*\*kwargs
@@ -57,9 +57,9 @@ arguments** in a function. Here is an example to get you going with it:
5757
>>> greet_me(name="yasoob")
5858
name == yasoob
5959
60-
So can you see how we handled a keyworded argument list in our function.
60+
So you can see how we handled a keyworded argument list in our function.
6161
This is just the basics of \*\*kwargs and you can see how useful it is.
62-
Now lets talk about how you can use \*args and \*\*kwargs to call a
62+
Now let's talk about how you can use \*args and \*\*kwargs to call a
6363
function with a list or dictionary of arguments.
6464

6565
Using \*args and \*\*kwargs to call a function
@@ -105,9 +105,9 @@ So if you want to use all three of these in functions then the order is
105105
When to use them?
106106
^^^^^^^^^^^^^^^^^
107107

108-
It really depends on what are your requirements. The most common use
108+
It really depends on what your requirements are. The most common use
109109
case is when making function decorators (discussed in another chapter).
110-
More over it can be used in monkey patching as well. Monkey patching
110+
Moreover it can be used in monkey patching as well. Monkey patching
111111
means modifying some code at runtime. Consider that you have a class
112112
with a function called ``get_info`` which calls an API and returns the
113113
response data. If we want to test it we can replace the API call with

0 commit comments

Comments
 (0)