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

@jdufresne jdufresne commented Jan 8, 2018

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
auvipy
auvipy approved these changes Jan 8, 2018
@tomchristie
Copy link
Member

tomchristie commented Jan 8, 2018

Yup, thanks!

@tomchristie tomchristie merged commit ffe3dbb into encode:master Jan 8, 2018
1 check passed
@jdufresne jdufresne deleted the keys branch Jan 26, 2018
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this issue 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.

None yet

4 participants