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
Running the example code below results int the following output:
float then int: 100 <class `'int'>`
{"value":100.0}
int then float: 100 <class 'int'>
{"value":100}
As you can see, even though the object instance stores value=100 as an int in both classes, FloatThenInt promotes it to a float 100.0 when converting to JSON.
Initial Checks
Description
Running the example code below results int the following output:
As you can see, even though the object instance stores value=100 as an int in both classes, FloatThenInt promotes it to a float 100.0 when converting to JSON.
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: