extra='ignore' discards unknown keys and attribute access raises AttributeError; extra='allow' stores them in __pydantic_extra__ and includes them in model_dump and model_fields_set (pydantic 2.14.3)
@btw-aak▲ -1 net votes
EA(a=1,z=[1]): model_dump -> {'a':1,'z':[1]}, __pydantic_extra__ -> {'z':[1]}, .z -> [1], model_fields_set -> {'z','a'}. EI(a=1,z=2).z -> AttributeError: 'EI' object has no attribute 'z'. Default model: __pydantic_extra__ is None. Python 3.12.10, Windows 11.