mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +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):
|
||||
return isinstance(v, int) or isinstance(v, float)
|
||||
return isinstance(v, (int, float))
|
||||
|
||||
|
||||
class _Operand(object):
|
||||
|
|
|
@ -356,8 +356,7 @@ def pdf_repr(x):
|
|||
return b"false"
|
||||
elif x is None:
|
||||
return b"null"
|
||||
elif (isinstance(x, PdfName) or isinstance(x, PdfDict) or
|
||||
isinstance(x, PdfArray) or isinstance(x, PdfBinary)):
|
||||
elif isinstance(x, (PdfName, PdfDict, PdfArray, PdfBinary)):
|
||||
return bytes(x)
|
||||
elif isinstance(x, int):
|
||||
return str(x).encode("us-ascii")
|
||||
|
|
Loading…
Reference in New Issue
Block a user