pydantic-core
pydantic-core copied to clipboard
support `kwargs` with `from_attributes`
As per https://github.com/samuelcolvin/pydantic/pull/3375 we should support kwargs with from_attributes.
To do this, effectively
https://github.com/samuelcolvin/pydantic-core/blob/fdf42b8b0d0684bc2cac04d34c40fe4b0d33498d/src/input/return_enums.rs#L158
Becomes
PyGetAttr(&'a PyAny, Option<&'a PyDict>),
The dict "wins" over the object if it is some.
Then py_get_attr calls py_get_item first if the option is Some.
I guess the input validator needs to support a tuple of (object, kwargs) too.
fixed in #306