22from base64 import b64decode
33from base64 import b64encode
44from numbers import Number
5- from typing import Any
6- from typing import Union
75
86from jsonschema ._format import FormatChecker
97
108
11- def is_int32 (instance : Any ) -> bool :
9+ def is_int32 (instance : object ) -> bool :
1210 # bool inherits from int, so ensure bools aren't reported as ints
1311 if isinstance (instance , bool ):
1412 return True
@@ -17,7 +15,7 @@ def is_int32(instance: Any) -> bool:
1715 return ~ (1 << 31 ) < instance < 1 << 31
1816
1917
20- def is_int64 (instance : Any ) -> bool :
18+ def is_int64 (instance : object ) -> bool :
2119 # bool inherits from int, so ensure bools aren't reported as ints
2220 if isinstance (instance , bool ):
2321 return True
@@ -26,7 +24,7 @@ def is_int64(instance: Any) -> bool:
2624 return ~ (1 << 63 ) < instance < 1 << 63
2725
2826
29- def is_float (instance : Any ) -> bool :
27+ def is_float (instance : object ) -> bool :
3028 # bool inherits from int
3129 if isinstance (instance , int ):
3230 return True
@@ -35,7 +33,7 @@ def is_float(instance: Any) -> bool:
3533 return isinstance (instance , float )
3634
3735
38- def is_double (instance : Any ) -> bool :
36+ def is_double (instance : object ) -> bool :
3937 # bool inherits from int
4038 if isinstance (instance , int ):
4139 return True
@@ -46,15 +44,15 @@ def is_double(instance: Any) -> bool:
4644 return isinstance (instance , float )
4745
4846
49- def is_binary (instance : Any ) -> bool :
47+ def is_binary (instance : object ) -> bool :
5048 if not isinstance (instance , (str , bytes )):
5149 return True
5250 if isinstance (instance , str ):
5351 return False
5452 return True
5553
5654
57- def is_byte (instance : Union [ str , bytes ] ) -> bool :
55+ def is_byte (instance : object ) -> bool :
5856 if not isinstance (instance , (str , bytes )):
5957 return True
6058 if isinstance (instance , str ):
@@ -64,7 +62,7 @@ def is_byte(instance: Union[str, bytes]) -> bool:
6462 return encoded == instance
6563
6664
67- def is_password (instance : Any ) -> bool :
65+ def is_password (instance : object ) -> bool :
6866 # A hint to UIs to obscure input
6967 return True
7068
0 commit comments