mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-13 17:25:49 +03:00
Add code comment
This commit is contained in:
parent
e37b3fb7d3
commit
0b8b3e679a
|
@ -29,6 +29,9 @@ class TagInfo(namedtuple("_TagInfo", "value name type length enum")):
|
|||
cls, value, name, type, length, enum or {})
|
||||
|
||||
def cvt_enum(self, value):
|
||||
# Using get will call hash(value), which can be expensive
|
||||
# for some types (e.g. Fraction). Since self.enum is rarely
|
||||
# used, it's usually better to test it first.
|
||||
return self.enum.get(value, value) if self.enum else value
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user