@@ -237,72 +237,90 @@ def _stock_java_converters() -> List[Converter]:
237237 ),
238238 Converter (
239239 name = "int -> java.lang.Byte" ,
240- predicate = lambda obj , ** hints : isinstance (obj , int )
241- and ("type" in hints and hints ["type" ] in ("b" , "byte" , "Byte" ))
242- and _jc .Byte .MIN_VALUE <= obj <= _jc .Byte .MAX_VALUE ,
240+ predicate = lambda obj , ** hints : (
241+ isinstance (obj , int )
242+ and ("type" in hints and hints ["type" ] in ("b" , "byte" , "Byte" ))
243+ and _jc .Byte .MIN_VALUE <= obj <= _jc .Byte .MAX_VALUE
244+ ),
243245 converter = _jc .Byte ,
244246 priority = Priority .HIGH ,
245247 ),
246248 Converter (
247249 name = "int -> java.lang.Short" ,
248- predicate = lambda obj , ** hints : isinstance (obj , int )
249- and ("type" in hints and hints ["type" ] in ("s" , "short" , "Short" ))
250- and _jc .Short .MIN_VALUE <= obj <= _jc .Short .MAX_VALUE ,
250+ predicate = lambda obj , ** hints : (
251+ isinstance (obj , int )
252+ and ("type" in hints and hints ["type" ] in ("s" , "short" , "Short" ))
253+ and _jc .Short .MIN_VALUE <= obj <= _jc .Short .MAX_VALUE
254+ ),
251255 converter = _jc .Short ,
252256 priority = Priority .HIGH ,
253257 ),
254258 Converter (
255259 name = "int -> java.lang.Integer" ,
256- predicate = lambda obj , ** hints : isinstance (obj , int )
257- and ("type" not in hints or hints ["type" ] in ("i" , "int" , "Integer" ))
258- and _jc .Integer .MIN_VALUE <= obj <= _jc .Integer .MAX_VALUE ,
260+ predicate = lambda obj , ** hints : (
261+ isinstance (obj , int )
262+ and ("type" not in hints or hints ["type" ] in ("i" , "int" , "Integer" ))
263+ and _jc .Integer .MIN_VALUE <= obj <= _jc .Integer .MAX_VALUE
264+ ),
259265 converter = _jc .Integer ,
260266 ),
261267 Converter (
262268 name = "int -> java.lang.Long" ,
263- predicate = lambda obj , ** hints : isinstance (obj , int )
264- and ("type" not in hints or hints ["type" ] in ("j" , "l" , "long" , "Long" ))
265- and _jc .Long .MIN_VALUE <= obj <= _jc .Long .MAX_VALUE ,
269+ predicate = lambda obj , ** hints : (
270+ isinstance (obj , int )
271+ and ("type" not in hints or hints ["type" ] in ("j" , "l" , "long" , "Long" ))
272+ and _jc .Long .MIN_VALUE <= obj <= _jc .Long .MAX_VALUE
273+ ),
266274 converter = _jc .Long ,
267275 priority = Priority .NORMAL - 1 ,
268276 ),
269277 Converter (
270278 name = "int -> java.math.BigInteger" ,
271- predicate = lambda obj , ** hints : isinstance (obj , int )
272- and (
273- "type" not in hints or hints ["type" ] in ("bi" , "bigint" , "BigInteger" )
279+ predicate = lambda obj , ** hints : (
280+ isinstance (obj , int )
281+ and (
282+ "type" not in hints
283+ or hints ["type" ] in ("bi" , "bigint" , "BigInteger" )
284+ )
274285 ),
275286 converter = lambda obj : _jc .BigInteger (str (obj )),
276287 priority = Priority .NORMAL - 2 ,
277288 ),
278289 Converter (
279290 name = "float -> java.lang.Float" ,
280- predicate = lambda obj , ** hints : isinstance (obj , float )
281- and ("type" not in hints or hints ["type" ] in ("f" , "float" , "Float" ))
282- and (
283- math .isinf (obj )
284- or math .isnan (obj )
285- or - _jc .Float .MAX_VALUE <= obj <= _jc .Float .MAX_VALUE
291+ predicate = lambda obj , ** hints : (
292+ isinstance (obj , float )
293+ and ("type" not in hints or hints ["type" ] in ("f" , "float" , "Float" ))
294+ and (
295+ math .isinf (obj )
296+ or math .isnan (obj )
297+ or - _jc .Float .MAX_VALUE <= obj <= _jc .Float .MAX_VALUE
298+ )
286299 ),
287300 converter = _jc .Float ,
288301 ),
289302 Converter (
290303 name = "float -> java.lang.Double" ,
291- predicate = lambda obj , ** hints : isinstance (obj , float )
292- and ("type" not in hints or hints ["type" ] in ("d" , "double" , "Double" ))
293- and (
294- math .isinf (obj )
295- or math .isnan (obj )
296- or - _jc .Double .MAX_VALUE <= obj <= _jc .Double .MAX_VALUE
304+ predicate = lambda obj , ** hints : (
305+ isinstance (obj , float )
306+ and ("type" not in hints or hints ["type" ] in ("d" , "double" , "Double" ))
307+ and (
308+ math .isinf (obj )
309+ or math .isnan (obj )
310+ or - _jc .Double .MAX_VALUE <= obj <= _jc .Double .MAX_VALUE
311+ )
297312 ),
298313 converter = _jc .Double ,
299314 priority = Priority .NORMAL - 1 ,
300315 ),
301316 Converter (
302317 name = "float -> java.math.BigDecimal" ,
303- predicate = lambda obj , ** hints : isinstance (obj , float )
304- and (
305- "type" not in hints or hints ["type" ] in ("bd" , "bigdec" , "BigDecimal" )
318+ predicate = lambda obj , ** hints : (
319+ isinstance (obj , float )
320+ and (
321+ "type" not in hints
322+ or hints ["type" ] in ("bd" , "bigdec" , "BigDecimal" )
323+ )
306324 ),
307325 converter = lambda obj : _jc .BigDecimal (str (obj )),
308326 priority = Priority .NORMAL - 2 ,
0 commit comments