134 except Exception:
135 pass
136
137 unresolved = list(filter(lambda x: x not in instances.keys(), unresolved))138
139 if len(unresolved):
140 token_prefix = 'Token '
Consider iterating the dictionary directly instead of calling .keys()
.
Using for key in dictionary
would always iterate the dictionary keys.
sounds = {"cow": "moo", "dog": "bark"}
for key in sounds.keys():
print(key)
sounds = {"cow": "moo", "dog": "bark"}
for key in sounds:
print(key)