Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Reworked how the decoder argument works #156
The decoder argument is actually required on a few other methods but wasn't there, specifically what happens when you need a decoder but you call service.get_auth_session() and it defaults to not passing a decoder to session.get_access_token()? It breaks.
Yes, you can replace the call to get_auth_session() with get_access_token() and get_session(), but why have the shortcut method if it doesn't work in all cases?
So what I've done here is added a parameter to the Session object itself, so you can set it once and forget it for good. I thought about adding it just to get_auth_session() but do we really want to be passing methods arguments then they could just as easily be set on the class?
Looks good overall. You might also want to add a simple unit test that shows the default decoder is the fn you expect and that passing in a custom decoder does what you expect. Also would be nice to see this mentioned in the docstring so the documentation is updated as well.
If we're going to get specific on the comparison, then perhaps the test
Also it turns out I was doing something wrong when I decided I needed this
On Fri, Apr 25, 2014 at 1:20 PM, Max Countryman firstname.lastname@example.org: