treq icon indicating copy to clipboard operation
treq copied to clipboard

StringStubbingResource docstring is wrong

Open mithrandi opened this issue 10 years ago • 1 comments

It says:

        :param dict headers: A dictionary of headers mapping header keys to
            a list of header values (sorted alphabetically)

While they should be lists, the code actually requires them to be single values, since the code calls setHeader. Using a list will result in the header field having a value of the repr of the list.

mithrandi avatar Feb 27 '16 21:02 mithrandi

The quoted text is discussing the arguments of the callable, but the next paragraph does call out that the return value must not be a list. This doesn't seem like great API design, but the docstring does appear to match the implementation.

twm avatar Nov 15 '16 02:11 twm