You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/pydantic_core/_pydantic_core.pyi
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -426,8 +426,9 @@ def to_json(
426
426
exclude_none: Whether to exclude fields that have a value of `None`.
427
427
round_trip: Whether to enable serialization and validation round-trip support.
428
428
timedelta_mode: How to serialize `timedelta` objects, either `'iso8601'` or `'float'`.
429
-
temporal_mode: How to serialize datetime like objects, either
430
-
`'iso8601'` or `'seconds'` or `'milliseconds'`.
429
+
temporal_mode: How to serialize datetime-like objects (`datetime`, `date`, `time`), either `'iso8601'`, `'seconds'`, or `'milliseconds'`.
430
+
`iso8601` returns an ISO 8601 string; `seconds` returns the Unix timestamp in seconds as a float; `milliseconds` returns the Unix timestamp in milliseconds as a float.
431
+
431
432
bytes_mode: How to serialize `bytes` objects, either `'utf8'`, `'base64'`, or `'hex'`.
432
433
inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'`, `'constants'`, or `'strings'`.
433
434
serialize_unknown: Attempt to serialize unknown types, `str(value)` will be used, if that fails
@@ -508,8 +509,9 @@ def to_jsonable_python(
508
509
exclude_none: Whether to exclude fields that have a value of `None`.
509
510
round_trip: Whether to enable serialization and validation round-trip support.
510
511
timedelta_mode: How to serialize `timedelta` objects, either `'iso8601'` or `'float'`.
511
-
temporal_mode: How to serialize datetime like objects, either
512
-
`'iso8601'` or `'seconds'` or `'milliseconds'`.
512
+
temporal_mode: How to serialize datetime-like objects (`datetime`, `date`, `time`), either `'iso8601'`, `'seconds'`, or `'milliseconds'`.
513
+
`iso8601` returns an ISO 8601 string; `seconds` returns the Unix timestamp in seconds as a float; `milliseconds` returns the Unix timestamp in milliseconds as a float.
514
+
513
515
bytes_mode: How to serialize `bytes` objects, either `'utf8'`, `'base64'`, or `'hex'`.
514
516
inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'`, `'constants'`, or `'strings'`.
515
517
serialize_unknown: Attempt to serialize unknown types, `str(value)` will be used, if that fails
0 commit comments