@@ -355,7 +355,7 @@ def to_json(
355355 round_trip : bool = False ,
356356 timedelta_mode : Literal ['iso8601' , 'float' ] = 'iso8601' ,
357357 bytes_mode : Literal ['utf8' , 'base64' ] = 'utf8' ,
358- inf_nan_mode : Literal ['null' , 'constants' ] = 'constants' ,
358+ inf_nan_mode : Literal ['null' , 'constants' , 'strings' ] = 'constants' ,
359359 serialize_unknown : bool = False ,
360360 fallback : Callable [[Any ], Any ] | None = None ,
361361 serialize_as_any : bool = False ,
@@ -376,7 +376,7 @@ def to_json(
376376 round_trip: Whether to enable serialization and validation round-trip support.
377377 timedelta_mode: How to serialize `timedelta` objects, either `'iso8601'` or `'float'`.
378378 bytes_mode: How to serialize `bytes` objects, either `'utf8'` or `'base64'`.
379- inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'` or `'constants '`.
379+ inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'`, `'constants'`, or `'strings '`.
380380 serialize_unknown: Attempt to serialize unknown types, `str(value)` will be used, if that fails
381381 `"<Unserializable {value_type} object>"` will be used.
382382 fallback: A function to call when an unknown value is encountered,
@@ -430,7 +430,7 @@ def to_jsonable_python(
430430 round_trip : bool = False ,
431431 timedelta_mode : Literal ['iso8601' , 'float' ] = 'iso8601' ,
432432 bytes_mode : Literal ['utf8' , 'base64' ] = 'utf8' ,
433- inf_nan_mode : Literal ['null' , 'constants' ] = 'constants' ,
433+ inf_nan_mode : Literal ['null' , 'constants' , 'strings' ] = 'constants' ,
434434 serialize_unknown : bool = False ,
435435 fallback : Callable [[Any ], Any ] | None = None ,
436436 serialize_as_any : bool = False ,
@@ -451,7 +451,7 @@ def to_jsonable_python(
451451 round_trip: Whether to enable serialization and validation round-trip support.
452452 timedelta_mode: How to serialize `timedelta` objects, either `'iso8601'` or `'float'`.
453453 bytes_mode: How to serialize `bytes` objects, either `'utf8'` or `'base64'`.
454- inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'` or `'constants '`.
454+ inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'`, `'constants'`, or `'strings '`.
455455 serialize_unknown: Attempt to serialize unknown types, `str(value)` will be used, if that fails
456456 `"<Unserializable {value_type} object>"` will be used.
457457 fallback: A function to call when an unknown value is encountered,
0 commit comments