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

Overload __mul__() to allow multiplication of StLb objects #6

Closed
rogfrich opened this issue Jun 12, 2022 · 0 comments
Closed

Overload __mul__() to allow multiplication of StLb objects #6

rogfrich opened this issue Jun 12, 2022 · 0 comments

Comments

@rogfrich
Copy link
Owner

As well as overloading the + and - operators, StLb should have the ability to multiply as well:

The multiplication factor should be a number - instance.in_lbs should be multiplied by the factor with two possible outcomes depending on context:

  • A new object is created from the result: new_instance = StLb(0, instance.in_lbs * factor)
  • The existing instance has its whole_stones, remainder_lbs and in_lbs values updated in place

I can't imagine a use case where I'd need to multiply two StLb objects together.

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

No branches or pull requests

1 participant