Skip to content

Conversation

@yothenberg
Copy link

The _validation function accepts the draw list and then mutates it by removing letters. Subsequent uses of the draw list are then invalid. The unit tests didn't catch it. I fixed the bug by copying the list for local mutation and I added an assertion to check that draw is not mutated during validation.

ATTENTION: before clicking "Create Pull Request" please submit some meta data, thanks!

Difficulty level (1-10): [2]
Estimated time spent (hours): [.25]
Completed (yes/no): [yes]
I stretched my coding skills (if yes what did you learn?): [yes, itertools.permutations]
Other feedback (what can we improve?): []

I added a test to check for a mutated draw during validation.
@yothenberg yothenberg changed the title I fixed a bug that was mutating the draw list during validation. PCC02 I fixed a bug that was mutating the draw list during validation. Dec 7, 2017
@yothenberg yothenberg changed the title PCC02 I fixed a bug that was mutating the draw list during validation. Solution C02 I fixed a bug that was mutating the draw list during validation. Dec 7, 2017
@bbelderbos
Copy link
Collaborator

Nice, thank you

@pybites
Copy link
Owner

pybites commented Dec 7, 2017

Good catch, thanks

@pybites pybites merged commit c7bda72 into pybites:solutions Dec 7, 2017
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.

3 participants