[issue27728] HTTPConnection.requests has a mutable as default value for headers

R. David Murray report at bugs.python.org
Wed Aug 10 14:53:43 EDT 2016


R. David Murray added the comment:

Well, it's a problem in general because if the called routine modifies the default dict...the default is modified.  I'm guessing it is never modified, but it is indeed better future proofing of the code to not use a mutable default in a routine that passes the variable to other functions, as this one does.

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27728>
_______________________________________


More information about the Python-bugs-list mailing list