balance() API, fix for functions that return a value (e.g. transactions()) & support for Google App Engine#1
Conversation
…s to use the urlfetch API to make an http/https call.
There was a problem hiding this comment.
Let's make this an unordered list by prefixing this line with a hyphen followed by a space. :)
There was a problem hiding this comment.
Sure, but not sure what you mean
There was a problem hiding this comment.
This will render as a list item:
- [PK](https://github.com/gae123)There was a problem hiding this comment.
Let's switch the branches to avoid the double negative.
There was a problem hiding this comment.
Sorry, could you elaborate what you mean?
There was a problem hiding this comment.
Rather than…
if not cond:
...
else: # if not not cond (double negative)
...Let's write…
if cond:
...
else: # if not cond
...There was a problem hiding this comment.
Does this need to be a global? Could we simply read the environment variable each time this function is invoked?
There was a problem hiding this comment.
It does not need to be, but there is less overhead in reading a python variable than looking up an OS environment variable. So the code reads the environment variable only once and then we use that value in subsequent calls.
There was a problem hiding this comment.
I don't know whether this overhead is significant, but if you want to avoid reading the environment variable multiple times you could use a closure:
def outer():
ss = ...
def inner(url, method, data):
# ss is accessible here
return inner
http_request = outer()There was a problem hiding this comment.
Avoid mutable default arguments. See http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments for details.
|
Hi David, is there any other issue you see, before you can integrate this change? |
|
If you resolve the merge conflicts I'll merge these changes. Thanks! |
Conflicts: README.md
|
Thanks, @gae123. Merging. |
No description provided.