Skip to content

Solution C02 I fixed a bug that was mutating the draw list during validation. #154

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

Merged
merged 1 commit into from
Dec 7, 2017

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