From: Avi Das Date: Sat, 22 Mar 2014 20:42:23 +0000 (-0500) Subject: Add __str__ to case insensitive dict. Logging headers for debugging purposes is often... X-Git-Tag: v2.3.0~4^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98ac3df71369a6cf9bde35b8e5c8dc5935b028d0;p=services%2Fpython-requests.git Add __str__ to case insensitive dict. Logging headers for debugging purposes is often necessary, and the currently logging the headers would be using __repr__ which would log the implementation detail of headers, caseinsensitivedict. Adding str lends a more printing and log friendly implementation for case insentitice dict --- diff --git a/requests/structures.py b/requests/structures.py index a175913..2addb93 100644 --- a/requests/structures.py +++ b/requests/structures.py @@ -108,6 +108,9 @@ class CaseInsensitiveDict(collections.MutableMapping): def __repr__(self): return '%s(%r)' % (self.__class__.__name__, dict(self.items())) + def __str__(self): + return '%s' % (dict(self.items()) + class LookupDict(dict): """Dictionary lookup object."""