@@ -353,7 +353,7 @@ def to_json(
353353 round_trip : bool = False ,
354354 timedelta_mode : Literal ['iso8601' , 'float' ] = 'iso8601' ,
355355 bytes_mode : Literal ['utf8' , 'base64' ] = 'utf8' ,
356- inf_nan_mode : Literal ['null' , 'constants' ] = 'constants' ,
356+ inf_nan_mode : Literal ['null' , 'constants' , 'strings' ] = 'constants' ,
357357 serialize_unknown : bool = False ,
358358 fallback : Callable [[Any ], Any ] | None = None ,
359359 serialize_as_any : bool = False ,
@@ -374,7 +374,7 @@ def to_json(
374374 round_trip: Whether to enable serialization and validation round-trip support.
375375 timedelta_mode: How to serialize `timedelta` objects, either `'iso8601'` or `'float'`.
376376 bytes_mode: How to serialize `bytes` objects, either `'utf8'` or `'base64'`.
377- inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'` or `'constants '`.
377+ inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'`, `'constants'`, or `'strings '`.
378378 serialize_unknown: Attempt to serialize unknown types, `str(value)` will be used, if that fails
379379 `"<Unserializable {value_type} object>"` will be used.
380380 fallback: A function to call when an unknown value is encountered,
@@ -428,7 +428,7 @@ def to_jsonable_python(
428428 round_trip : bool = False ,
429429 timedelta_mode : Literal ['iso8601' , 'float' ] = 'iso8601' ,
430430 bytes_mode : Literal ['utf8' , 'base64' ] = 'utf8' ,
431- inf_nan_mode : Literal ['null' , 'constants' ] = 'constants' ,
431+ inf_nan_mode : Literal ['null' , 'constants' , 'strings' ] = 'constants' ,
432432 serialize_unknown : bool = False ,
433433 fallback : Callable [[Any ], Any ] | None = None ,
434434 serialize_as_any : bool = False ,
@@ -449,7 +449,7 @@ def to_jsonable_python(
449449 round_trip: Whether to enable serialization and validation round-trip support.
450450 timedelta_mode: How to serialize `timedelta` objects, either `'iso8601'` or `'float'`.
451451 bytes_mode: How to serialize `bytes` objects, either `'utf8'` or `'base64'`.
452- inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'` or `'constants '`.
452+ inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'`, `'constants'`, or `'strings '`.
453453 serialize_unknown: Attempt to serialize unknown types, `str(value)` will be used, if that fails
454454 `"<Unserializable {value_type} object>"` will be used.
455455 fallback: A function to call when an unknown value is encountered,
0 commit comments