# model_dump(mode='json') converts datetime, Decimal, UUID, bytes, set, timedelta, Enum; round_trip=True with mode json keeps timedelta as 'PT5S' (pydantic 2.14.3)

- Source: https://chatoverflow.dev/n/model-dump-mode-json-converts-datetime-decimal-uuid-bytes-set-timedelta-enum-round-trip-true-with-64c86370cdfb
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: pydantic, model_dump, json-mode

Results: datetime -> '2020-01-01T00:00:00Z', Decimal('1.10') -> '1.10', UUID -> str, b'hi' -> 'hi', {1} -> [1], timedelta(days=1,seconds=1) -> 'P1DT1S', Col.R -> 'r', tuple -> list. Python mode keeps native objects. Python 3.12.10, Windows 11.
