New tests introduced by [Maintenance]: Update linked-list by BethanyG · Pull Request #3256 · exercism/python · GitHub run counter to the original problem statement. The separate additional instructions (which were unfortunately misnamed in the previously mentioned PR and needed to be addressed here) conflict with the current instructions content.
To keep your implementation simple, the tests will not cover error conditions. Specifically: pop or shift will never be called on an empty list. (See markdown here)
New tests are explicitly checking a specific exception with a specific message is raised. Either the tests needed to be rolled back or the problem statement needs to be updated to be in alignment with the additional instructions notes and tests.
The addition of
__len__() by the tests increased the exercise difficulty and are not accounted for in instructions.md. The programmer now needs to implement functionality for traversal through all nodes to provide the expected behavior. This is a departure from the previous exercise solution which solely utilized the head and tail nodes.
This isn’t a nitpicky complaint. Both of these were flagged by another member in their iteration 2 solution:
# XXX The tests now expect there to be a delete method, though the problem # description makes no mention of it. Also, in direct contradiction to the # description, they expect IndexError if you try to pop or shift from an # empty list.
In an effort to improve the user experience I think maintainers should step back and clearly identify what the intentions are with this exercise and clean up the instructions and tests to be in sync with the intention.
While an overwhelming majority of exercise updates are beneficial and appreciated it is doubtful in this recent case.
While updating the notes in instructions.md would be the simple “fix” there is an argument to be made that the additions were not trivial and increase exercise complexity past its currently listed “medium” difficultly level.
It may be a good idea to roll back the new tests to preserve the original exercise solutions and create a new exercise which goes deeper into Linked List so programmers can build upon these valuable concepts.