Skip to content

balance() API, fix for functions that return a value (e.g. transactions()) & support for Google App Engine#1

Merged
davidchambers merged 17 commits intoplaid:masterfrom
gae123:master
Apr 14, 2014
Merged

balance() API, fix for functions that return a value (e.g. transactions()) & support for Google App Engine#1
davidchambers merged 17 commits intoplaid:masterfrom
gae123:master

Conversation

@gae123
Copy link
Copy Markdown
Contributor

@gae123 gae123 commented Mar 25, 2014

No description provided.

Comment thread README.md Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this an unordered list by prefixing this line with a hyphen followed by a space. :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but not sure what you mean

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will render as a list item:

- [PK](https://github.com/gae123)

Comment thread plaid/http.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's switch the branches to avoid the double negative.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, could you elaborate what you mean?

PK
http://www.gae123.com

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than…

if not cond:
    ...
else:  # if not not cond (double negative)
    ...

Let's write…

if cond:
    ...
else:  # if not cond
    ...

@gae123 gae123 changed the title balance() API and fix for functions that return a value (e.g. transactions()) balance() API, fix for functions that return a value (e.g. transactions()) & support for Google App Engine Apr 11, 2014
Comment thread plaid/http.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be a global? Could we simply read the environment variable each time this function is invoked?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()

Comment thread plaid/http.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gae123
Copy link
Copy Markdown
Contributor Author

gae123 commented Apr 13, 2014

Hi David, is there any other issue you see, before you can integrate this change?

@davidchambers
Copy link
Copy Markdown
Contributor

If you resolve the merge conflicts I'll merge these changes. Thanks!

@davidchambers
Copy link
Copy Markdown
Contributor

Thanks, @gae123. Merging.

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