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:
434434
435435 Parameters
436436 ----------
437- value : Any
437+ value: Any
438438 Value to parse
439439
440440 Returns
@@ -456,20 +456,19 @@ def _dump_float(value: float) -> Union[float, str]:
456456
457457 Parameters
458458 ----------
459- value : float
459+ value: float
460460 Value to dump
461461
462462 Returns
463463 -------
464464 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
467466 """
468467 if value == float ("inf" ):
469468 return INFINITY
470469 if value == - float ("inf" ):
471470 return NEG_INFINITY
472- if value == float ( "nan" ):
471+ if isinstance ( value , float ) and math . isnan ( value ):
473472 return NAN
474473 return value
475474
You can’t perform that action at this time.
0 commit comments