I researched the validate_assignment feature in the pydantic_core project and need to understand how Rust translates to Python. When Rust builds, it creates a folder called python/pydantic_core that includes files like core_schema.py and _pydantic_core.py based on the core of Pydantic.
I noticed that when Python generates a schema, it sets every overridden function as a JSON object like this:
{
'type': 'function-after',
'function': {'type': 'no-info', 'function': function},
...
}
This gets converted to a dictionary. For the _model_wrap_validator, the type is set as type='function-wrap', and the function name is no_info_wrap_validator_function. This helped me understand that Rust flags every function accordingly. We are now getting closer to finishing a real Rust project.