eshad / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

please pass method to request by name instead of positionally #252

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
> What steps will reproduce the problem?
i am getting
"new_request() takes at most 1 positional argument (2 given)"
in my appengine logs over and over.  i believe the culprit is in httplib2, 
where there are several calls to request that pass the method parameter 
positionally, even though it is declared with a default value.

python allows this, but if one takes the point of view that the order of 
parameters with default values is not part of the public api and that clients 
who depend on that order are pathological and therefore not supported, then the 
code i am using that demands that clients not pass such parameters positionally 
is supported and httplib2's usage of its own methods is not.  so i get to claim 
this is a bug in httplib2.

please make all calls to request only pass the method param by name, e.g. 
method='GET', so that my code doesn't break.

> What is the expected output? What do you see instead?
i expect all calls inside httplib2 to tolerate overrides to request that demand 
method is passed only by name and not positionally.  i further propose that 
this be fixed by simply making httplib2 pass method to request by name instead 
of positionally, which should be easy.

Original issue reported on code.google.com by ccala...@google.com on 22 Mar 2013 at 1:19

GoogleCodeExporter commented 9 years ago
Can you provide some code snippets causing this?

Original comment by dhermes@google.com on 22 Mar 2013 at 2:27

GoogleCodeExporter commented 9 years ago
Code out for review: https://codereview.appspot.com/7987046/

Original comment by jcgregorio@google.com on 26 Mar 2013 at 1:54

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 93291649202b.

Original comment by joe.gregorio@gmail.com on 26 Mar 2013 at 6:18