datafolklabs/drest — pull request #28 by spookylukey (2013-11-12 11:54:15+00:00)
Title: Fixed mutable default argument bug in multiple places.

Using mutable default arguments in Python is asking for trouble.

In using drest, I'm pretty sure that I came up against this trouble in practice - I had requests that were using headers from previous requests. My code was involved, so it's hard to track down. I did pin down a set of steps that reliably showed the problem, and after fixed all the mutable default arguments I could find, and the problem stopped. I don't know which one in particular was the fix, but they are all bugs waiting to happen.

I ran the tests, and got the same number of failures before and after.

BTW, thanks for this library, it's working really well for my use case, which requires quite a few customisations but you've already got all the hooks I need - cheers!