Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Fix bank account regression #2112

Merged
merged 4 commits into from
Mar 5, 2014
Merged

Fix bank account regression #2112

merged 4 commits into from
Mar 5, 2014

Conversation

chadwhitacre
Copy link
Contributor


_customer = None # underlying balanced.Customer object
_thing = None # underlying balanced.{BankAccount,Card} object

def _get(self, name, default=""):
def __getitem__(self, key, default=""):

Choose a reason for hiding this comment

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

I'm bad at Python, but did you mean to change this? was this part of the bug?

Choose a reason for hiding this comment

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

I think it's incidental to the bug, which was introduced in BalancedCard.__getitem__. Simplifying the way things are accessed in BalancedThings reduces the chance of this happening in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What @grampajoe said.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure how getitem works with 3 parameters. I think it is supposed to have only 2. See http://docs.python.org/2/reference/datamodel.html#object.__getitem__

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Removed in c1cc22a.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

P.S. Removing the default argument and returning None in the default case led to #2161.

@seanlinsley seanlinsley mentioned this pull request Mar 4, 2014
Changaco added a commit that referenced this pull request Mar 5, 2014
@Changaco Changaco merged commit 1a10327 into master Mar 5, 2014
@Changaco Changaco deleted the fix-bank-account-regression branch March 5, 2014 20:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants