Skip to content

Test that original list is not modified for high scores tests#1868

Closed
adamzev wants to merge 2 commits into
exercism:masterfrom
adamzev:patch-1
Closed

Test that original list is not modified for high scores tests#1868
adamzev wants to merge 2 commits into
exercism:masterfrom
adamzev:patch-1

Conversation

@adamzev
Copy link
Copy Markdown

@adamzev adamzev commented Jul 27, 2019

The mentor notes mention the importance of using sorted() instead of sort() (which mutates the list and makes subsequent calls to latest incorrect) but this case is not currently tested for and easy for mentors to miss.

The mentor notes mention the importance of using `sorted()` instead of `sort()` (which mutates the list and makes subsequent calls to `latest` incorrect) but this case is not currently tested for and easy for mentors to miss.
@adamzev adamzev requested a review from a team as a code owner July 27, 2019 22:01
list.copy is not available in Python 2.7
@cmccandless
Copy link
Copy Markdown
Contributor

This is an issue that has been raised multiple times (#1735, #1745), and was one of the driving forces for converting the exercise from a class-based implementation to a funciton-based one.

If the mentor notes indicate that immutability is a requirement, they are wrong and need amended.

If the mentor notes simply state that immutability is a strong recommendation, that is perfectly valid; this exercise is an early core exercise, and is meant to be a simple practice in working with arrays. Immutability is a subject for a later exercise.

@adamzev
Copy link
Copy Markdown
Author

adamzev commented Jul 29, 2019

It is difficult for me to tell from the mentor notes what is a suggestion and what is a requirement for accepting the exercise. All the reasonable solutions use sorted. My assumption was that more was required than just passing the tests or the acceptance would have been automatic and based on that. I'll close this, read the other threads (I did try a search or two first, sorry about the duplicate) and look into clarifying the mentor notes.

@adamzev
Copy link
Copy Markdown
Author

adamzev commented Jul 29, 2019

If the mentor notes indicate that immutability is a requirement, they are wrong and need amended.

I wouldn't say the current mentor notes are wrong, just a bit too open for interpretation. I created a pull request on the notes.

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