Breaking Changes
Code Generation Changes
- Non-finite float values now render as structural
float(...)expressions - Generated code for non-finite floats (inf,-inf,nan) from Protocol Buffers, XML Schema, and AsyncAPI-embedded schemas — as field defaults, constraint bounds, list items, and enum values — now renders inline asfloat('inf'),float('-inf'), andfloat('nan')instead of emitting bareinf/nanliterals with an injectedfrom math import inf, nanheader. Users relying on the previous output (e.g. snapshot/golden tests, or importinginf/nanfrom the generated module) will see different generated code (#3770)
# Before
from math import inf
class Model(BaseModel):
value: float | None = inf
# After
class Model(BaseModel):
value: float | None = float('inf')What's Changed
- Update CHANGELOG for 0.73.0 by @dcg-generated-docs[bot] in #3767
- Update release benchmark data by @dcg-generated-docs[bot] in #3768
- Deploy release benchmark data updates by @koxudaxi in #3771
- fix(parser): render non-finite values structurally by @Aryan-Pardeshi in #3770
New Contributors
- @Aryan-Pardeshi made their first contribution in #3770
Full Changelog: 0.73.0...0.74.0