Test that original list is not modified for high scores tests#1868
Test that original list is not modified for high scores tests#1868adamzev wants to merge 2 commits into
Conversation
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.
list.copy is not available in Python 2.7
|
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. |
|
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 |
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. |
The mentor notes mention the importance of using
sorted()instead ofsort()(which mutates the list and makes subsequent calls tolatestincorrect) but this case is not currently tested for and easy for mentors to miss.