Use dict comprehension in ImageFileDirectory_v2.named()

This commit is contained in:
Jon Dufresne 2019-05-26 06:56:01 -07:00
parent e24b494f88
commit 42602b69f3

View File

@ -523,8 +523,7 @@ class ImageFileDirectory_v2(MutableMapping):
Returns the complete tag dictionary, with named tags where possible.
"""
return dict((TiffTags.lookup(code).name, value)
for code, value in self.items())
return {TiffTags.lookup(code).name: value for code, value in self.items()}
def __len__(self):
return len(set(self._tagdata) | set(self._tags_v2))