Skip to content

Prefer iterating dict instead of calling dict.keys() #151

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

Closed
wants to merge 1 commit into from
Closed

Prefer iterating dict instead of calling dict.keys() #151

wants to merge 1 commit into from

Conversation

jdufresne
Copy link
Member

Calling dict.keys() is unnecessary. iter(dict) is equivalent to dict.keys(). 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. iter(dict) is equivalent to
dict.keys(). Inspired by Lennart Regebro's talk "Prehistoric Patterns in
Python" from PyCon 2017.

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

codecov bot commented Jan 5, 2018

Codecov Report

Merging #151 into master will increase coverage by 1.14%.
The diff coverage is 80%.

@@            Coverage Diff             @@
##           master     #151      +/-   ##
==========================================
+ Coverage   69.35%   70.49%   +1.14%     
==========================================
  Files          49       49              
  Lines        4708     4989     +281     
  Branches      800      864      +64     
==========================================
+ Hits         3265     3517     +252     
- Misses       1088     1120      +32     
+ Partials      355      352       -3
Impacted Files Coverage Δ
Lib/ldap/modlist.py 87.71% <100%> (+3.1%) ⬆️
Lib/ldap/cidict.py 69.23% <100%> (+1.23%) ⬆️
Lib/ldif.py 75.84% <100%> (-0.13%) ⬇️
Lib/ldap/schema/models.py 70.92% <25%> (-0.15%) ⬇️
Lib/ldapurl.py 78.1% <80%> (ø) ⬆️
Lib/ldap/schema/subentry.py 68.53% <87.5%> (ø) ⬆️
Lib/ldap/ldapobject.py 71% <0%> (+2.77%) ⬆️
Lib/ldap/compat.py 70% <0%> (+3.96%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98c535b...1838892. Read the comment docs.

@encukou
Copy link
Member

encukou commented Jan 5, 2018

Duplicate of #138
(Jon filed the duplicate because of my mistake.)

@encukou encukou marked this as a duplicate of #138 Jan 5, 2018
@encukou encukou closed this Jan 5, 2018
@jdufresne jdufresne deleted the drop-has-keys2 branch March 30, 2018 12:51
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy