konradhalas / dacite

Simple creation of data classes from dictionaries.
MIT License
1.76k stars 106 forks source link

Adding a special case for floats that are passed the strings "nan" or "inf" #257

Open djpadz opened 5 months ago

djpadz commented 5 months ago

A case could be made for or against this, but we had a situation where dacite was being used to import data from a JSON file. Since JSON doesn't support INF and NAN as numeric values, from_dict was failing if those values were passed as strings.