Skip to content
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

advent 2017 day 5 functions mutate the list #24

Closed
wants to merge 1 commit into from

Conversation

ClementSreeves
Copy link

I think it would be good to create a copy of M within the run and run2 functions to avoid mutating the list that is passed in - it worked out fine since you created the input each time, but it would have gone wrong if you had only created it once.

@norvig
Copy link
Owner

norvig commented Dec 6, 2017

That's a good point. Let me think about the right way to do it. I might do something like
def run(program): M = list(program) ...

@ClementSreeves
Copy link
Author

Closing as issue has been resolved.

@ClementSreeves ClementSreeves deleted the copy-list branch December 6, 2017 12:58
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.

None yet

2 participants