mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-28 02:46:18 +03:00
Merge pull request #3680 from jdufresne/isinstance
Merge multiple isinstance() calls to one
This commit is contained in:
commit
b84ab5223d
|
@ -28,7 +28,7 @@ VERBOSE = 0
|
||||||
|
|
||||||
|
|
||||||
def _isconstant(v):
|
def _isconstant(v):
|
||||||
return isinstance(v, int) or isinstance(v, float)
|
return isinstance(v, (int, float))
|
||||||
|
|
||||||
|
|
||||||
class _Operand(object):
|
class _Operand(object):
|
||||||
|
|
|
@ -356,8 +356,7 @@ def pdf_repr(x):
|
||||||
return b"false"
|
return b"false"
|
||||||
elif x is None:
|
elif x is None:
|
||||||
return b"null"
|
return b"null"
|
||||||
elif (isinstance(x, PdfName) or isinstance(x, PdfDict) or
|
elif isinstance(x, (PdfName, PdfDict, PdfArray, PdfBinary)):
|
||||||
isinstance(x, PdfArray) or isinstance(x, PdfBinary)):
|
|
||||||
return bytes(x)
|
return bytes(x)
|
||||||
elif isinstance(x, int):
|
elif isinstance(x, int):
|
||||||
return str(x).encode("us-ascii")
|
return str(x).encode("us-ascii")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user