@@ -165,7 +165,7 @@ class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
165
165
session.cookies to support dict operations.
166
166
167
167
Requests does not use the dict interface internally; it's just for
168
- compatibility with external client code. All ` requests` code should work
168
+ compatibility with external client code. All requests code should work
169
169
out of the box with externally provided instances of ``CookieJar``, e.g.
170
170
``LWPCookieJar`` and ``FileCookieJar``.
171
171
@@ -275,8 +275,9 @@ def get_dict(self, domain=None, path=None):
275
275
def __getitem__ (self , name ):
276
276
"""Dict-like __getitem__() for compatibility with client code. Throws
277
277
exception if there are more than one cookie with name. In that case,
278
- use the more explicit get() method instead. Caution: operation is O(n),
279
- not O(1)."""
278
+ use the more explicit get() method instead.
279
+
280
+ .. warning:: operation is O(n), not O(1)."""
280
281
281
282
return self ._find_no_duplicates (name )
282
283
@@ -320,11 +321,11 @@ def _find(self, name, domain=None, path=None):
320
321
raise KeyError ('name=%r, domain=%r, path=%r' % (name , domain , path ))
321
322
322
323
def _find_no_duplicates (self , name , domain = None , path = None ):
323
- """__get_item__ and get call _find_no_duplicates -- never used in
324
- Requests internally . Takes as args name and optional domain and path.
325
- Returns a cookie.value. Throws KeyError if cookie is not found and
326
- CookieConflictError if there are multiple cookies that match name and
327
- optionally domain and path."""
324
+ """Both `` __get_item__`` and `` get`` call this function: it's never
325
+ used elsewhere in Requests . Takes as args name and optional domain and
326
+ path. Returns a cookie.value. Throws KeyError if cookie is not found
327
+ and CookieConflictError if there are multiple cookies that match name
328
+ and optionally domain and path."""
328
329
toReturn = None
329
330
for cookie in iter (self ):
330
331
if cookie .name == name :
0 commit comments