Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove superfluous list calls from around map #8991

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 2 commits into from
Aug 5, 2017

Conversation

adeak
Copy link
Contributor

@adeak adeak commented Aug 5, 2017

In python 2 map already returns a list, and as far as I know (and as checked for 3.5) in python 3 any iterable can be unpacked on assignment.

  • The first commit removes list() calls from unpacking assignments of the form x,y = list(map(fun,seq)).
  • The second commit removes an unrelated instance of list(map()) where the resulting object is directly consumed by another map call on the next line. Considering how this change is qualitatively different from the other, more trivial ones, I separated this change for ease of cherry-picking if necessary.

@NelleV NelleV merged commit 66270ba into matplotlib:master Aug 5, 2017
@adeak adeak deleted the nolistmap_unpacking branch August 5, 2017 15:19
@tacaswell
Copy link
Member

@adeak Thanks! Congratulations on your first Matplotlib contribution 🎉 ! Hopefully we will hear from you again.

@adeak
Copy link
Contributor Author

adeak commented Aug 5, 2017

@tacaswell Thank you very much, I'm glad I could finally be of use:)

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Aug 5, 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.

4 participants