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

Perfer iter(dict) over iter(dict.keys()) #5736

Merged
merged 1 commit into from
Jan 8, 2018
Merged

Perfer iter(dict) over iter(dict.keys()) #5736

merged 1 commit into from
Jan 8, 2018

Conversation

jdufresne
Copy link
Contributor

Calling dict.keys() is unnecessary. The two are functionally equivalent on modern Pythons.

Inspired by Lennart Regebro's talk "Prehistoric Patterns in Python" from PyCon 2017.

https://www.youtube.com/watch?v=V5-JH23Vk0I

Calling dict.keys() is unnecessary. The two are functionally equivalent
on modern Pythons.

Inspired by Lennart Regebro's talk "Prehistoric Patterns in Python" from
PyCon 2017.

https://www.youtube.com/watch?v=V5-JH23Vk0I
@tomchristie
Copy link
Member

Yup, thanks!

@tomchristie tomchristie merged commit ffe3dbb into encode:master Jan 8, 2018
@jdufresne jdufresne deleted the keys branch January 26, 2018 02:07
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
Calling dict.keys() is unnecessary. The two are functionally equivalent
on modern Pythons.

Inspired by Lennart Regebro's talk "Prehistoric Patterns in Python" from
PyCon 2017.

https://www.youtube.com/watch?v=V5-JH23Vk0I
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants