clarity™
authorKenneth Reitz <me@kennethreitz.com>
Mon, 26 Sep 2011 01:04:13 +0000 (21:04 -0400)
committerKenneth Reitz <me@kennethreitz.com>
Mon, 26 Sep 2011 01:05:27 +0000 (21:05 -0400)
requests/sessions.py

index 7e5fa61fbca337c6fb8b2c4ad99e15e084e7de28..b6c4db7046bbec5b7104b44f16383f4271785ff6 100644 (file)
@@ -19,22 +19,17 @@ from .utils import add_dict_to_cookiejar
 def merge_kwargs(local_kwarg, default_kwarg):
     """Merges kwarg dictionaries.
 
-    If a key in the dictionary is set to None, i
+    If a local key in the dictionary is set to None, it will be removed.
     """
 
     # Bypass if not a dictionary (e.g. timeout)
     if not hasattr(local_kwarg, 'items'):
         return local_kwarg
 
+    # Update new values.
     kwargs = default_kwarg.copy()
     kwargs.update(local_kwarg)
 
-    # from clint.textui import colored
-
-
-    # print colored.red(default_kwarg)
-    # print colored.red(local_kwarg)
-
     # Remove keys that are set to None.
     for (k,v) in local_kwarg.items():
         if v is None:
@@ -130,7 +125,7 @@ class Session(object):
                         _kwargs[attr] = new_attr
 
                 # Make sure we didn't miss anything.
-                for (k, v) in kwargs:
+                for (k, v) in kwargs.items():
                     if k not in _kwargs:
                         _kwargs[k] = v