Bryan Bishop added the comment:
On Tue, Jan 1, 2013 at 5:41 AM, Antoine Pitrou wrote:
> Another possibility would be to allow passing None in values of the `headers`
> dict, in which case the given header wouldn't be send at all.
I agree that your solution is more scaling-friendly than the patch I originally
submitted. But from another perspective, consider how alien it is to have to
explicitly add keys set to None in the headers to get desired behavior.
Maybe there could be a single flag "strict" (or possibly a better name) that
would indicate that the dict is in fact what I want to send and that it should
not be modified? Or perhaps there should be "base_headers" list (not a
dictionary) of header keys of which defaults to not inject?
Also, would making {"Accept-Encoding": None} send no "Accept-Encoding" header
be backwards incompatible with the current behavior?
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue16830>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com