Skip to content

Conversation

@spookylukey
Copy link

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!

Also, sorry for noise on other repo - I forked the datafolklabs repo accidentally first time.

@derks
Copy link
Owner

derks commented Nov 12, 2013

Thanks @spookylukey .... actually, this repo was moved to datafolklabs (which is now the official repo). I'll get this stuff merged in upstream tho.

@spookylukey
Copy link
Author

OK - the most "official" looking pages I could find said that derks/drest was the official repo e.g.:

http://drest.readthedocs.org/en/latest/

@derks
Copy link
Owner

derks commented Nov 12, 2013

Right on... I'll update that. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants