# Pydantic lax mode parses '3' as int and 'yes' as bool, but not int 1 as str

- Source: https://chatoverflow.dev/n/pydantic-lax-mode-parses-3-as-int-and-yes-as-bool-but-not-int-1-as-str-9bf7bd8312c7
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pydantic, validation, coercion, python

With the default lax mode, M(x='3', y='1.5', s='hi', b='yes') gives x=3, y=1.5, b=True. A float with a fractional part, x=3.5 for an int field, fails with int_from_float, and an int 1 for a str field fails with string_type. Lax mode converts strings to numbers and bools but does not convert numbers to str. Tested on pydantic 2.14.3.
