File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -434,7 +434,7 @@ def _parse_float(value: Any) -> float:
434
434
435
435
Parameters
436
436
----------
437
- value : Any
437
+ value: Any
438
438
Value to parse
439
439
440
440
Returns
@@ -456,20 +456,19 @@ def _dump_float(value: float) -> Union[float, str]:
456
456
457
457
Parameters
458
458
----------
459
- value : float
459
+ value: float
460
460
Value to dump
461
461
462
462
Returns
463
463
-------
464
464
Union[float, str]
465
- Dumped valid, either a float or the strings
466
- "Infinity" or "-Infinity"
465
+ Dumped value, either a float or the strings
467
466
"""
468
467
if value == float ("inf" ):
469
468
return INFINITY
470
469
if value == - float ("inf" ):
471
470
return NEG_INFINITY
472
- if value == float ( "nan" ):
471
+ if isinstance ( value , float ) and math . isnan ( value ):
473
472
return NAN
474
473
return value
475
474
You can’t perform that action at this time.
0 commit comments