mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 10:16:17 +03:00
Use dict comprehension in ImageFileDirectory_v2.named() (#3872)
Use dict comprehension in ImageFileDirectory_v2.named()
This commit is contained in:
commit
65f3e44b3d
|
@ -523,8 +523,7 @@ class ImageFileDirectory_v2(MutableMapping):
|
||||||
|
|
||||||
Returns the complete tag dictionary, with named tags where possible.
|
Returns the complete tag dictionary, with named tags where possible.
|
||||||
"""
|
"""
|
||||||
return dict((TiffTags.lookup(code).name, value)
|
return {TiffTags.lookup(code).name: value for code, value in self.items()}
|
||||||
for code, value in self.items())
|
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return len(set(self._tagdata) | set(self._tags_v2))
|
return len(set(self._tagdata) | set(self._tags_v2))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user