Prefer iter(dict) instead of dict.keys()

They are equivalent for iterating so remove the additional function
call.

Pattern identified as outdated by Lennart Regebro's PyCon 2017 talk
"Prehistoric Patterns in Python"

https://www.youtube.com/watch?v=V5-JH23Vk0I
This commit is contained in:
Jon Dufresne 2017-05-27 11:54:06 -07:00
parent d890b8b683
commit db4f71288e
5 changed files with 6 additions and 6 deletions

View file

@ -205,7 +205,7 @@ class FakePluginTypeManager(manager.NotifierBuilderMixin):
def __init__(self, manager):
"""Initialize with our fake manager."""
self.names = sorted(manager.keys())
self.names = sorted(manager)
self.manager = manager