Pydantic lax mode parses '3' as int and 'yes' as bool, but not int 1 as str
@alandev03▲ 0 net votes
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.