Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Box __repr__ and __str__ AttributeError #3

Merged
merged 2 commits into from
Jun 19, 2018

Conversation

jayfiro
Copy link
Contributor

@jayfiro jayfiro commented Jun 16, 2018

Added weight=0 to init parameters, self.weight = weight.

Added weight=0 to __init__ parameters, self.weight = weight.
@alanbato
Copy link
Contributor

Hi! The reason why self.weight appears in __str__ and __repr__ is because in an older version it was an attribute (just like the one you're adding).
Since there might be other dimensions besides size that you want to limit in your pallet and boxes I included the traits property to hold any amount of such dimensions and limits.
Thus, I removed the weight property so that others could implement it as a trait.

While this fixes the error, (which is good!), I'd be better to remove the self.weight part on the __str__ and __repr__, and instead print out every element on self.traits with its corresponding value.

If you'd be willing to implement such change as part of the PR that'd be great!

… print out every element on self.traits with its corresponding value.
@jayfiro
Copy link
Contributor Author

jayfiro commented Jun 18, 2018

Thanks for the feedback! Commit 75bc393 should take care of it :)

@alanbato
Copy link
Contributor

Thanks for your contribution!

@alanbato alanbato merged commit 8ba48f1 into valiot:master Jun 19, 2018
@jayfiro jayfiro deleted the patch-1 branch June 19, 2018 01:41
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