-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Clock] Improved/additional tests for __add__ and __sub__ #3008
Comments
This comment was marked as resolved.
This comment was marked as resolved.
Hi @IsaacG 👋🏽 Thanks for filing this issue. Since the The To that end, the test generation template, example solution, and generated test files would need to be altered. You might also have to change the test toml file. But I question if we really want to change the cases. The cannoncial data clearly shows that the result of Rather than going back over this exercise again, I'd rather develop one that would set up and get at the pitfalls of mutability. Overloading this one doesn't feel like a good strategy. In the past, High Scores was a In fact, either altering High Scores or making an additional OOP version that gets at mutability issues would be a very welcome addition, should you want to take that on. We don't have a lot of practice exercises that really dig into why you would set up a class in a specific way, or when (or when not to) mutate attributes/return altered objects/return new objects. |
Another exercise that could be "riffed on" or extended is matrix. The current exercise doesn't get at altering or updating the |
Adding another note here. this issue gets at a somewhat related issue. Although the opposite of what is described here -- in issue #2926, mutation (and the mutation being reflected in the |
Thank you for your response, Bathany. I filed an issue against the problem specs to discuss if changing the canonical expectation around Clock's add and subtract make sense. Having been part of the discussion on multiple discussions around Matrix updates, I'm hesitant to suggest that it be extended to support mutability. Doing so in a clean fashion would mean having Updating High Scores to address mutability sounds good to me and something I'd be willing to tackle.
|
Elsewhere. Maybe we do it in 2786, since that's the last filed issue against High Scores, and does discuss mutability. That way, the author of that issue will also get a ping letting him know you've picked it up - in case he wants to join in the discussion. I think (for now) we close this issue -- and also the other
Thats what the original class-based High Scores did, and you can see that in the
This may be a case where simply re-instituting the exercise as it was in 2018/2019 will do the trick, and then altering the test generation template to import the class instead of functions, and changing the But I think we should also take a look at the point you were making with I will also copy this comment over to issue #2786, and then close this. |
Motivation: I've seem multiple solutions where
Clock.__add__
either (1) returns astr
or (2) modifies and returnsself
. Ideallya = b + c
should not mutateb
orc
andClock + int
should return aClock
.Proposal: Add a test or two where,
Possibly replicate for
__sub__
as well.I'd be happy to work on this myself.
The text was updated successfully, but these errors were encountered: