Distinguishing between "set to default" and "accepted default" in Pydantic?
Is there a way of distinguishing between "accepted the default" and "missing" in Pydantic?
Example:
from pydantic import BaseModel
class Test(BaseModel):
c: str | None = None
k1 = Test.model_validate({'c': None})
k2 = Test.model_validate({})
I'd like to be able to distinguish between case k1, where c was explicitly set to the default, compared to k2 where field was not supplied at all.