Samuel Colvin
Samuel Colvin
Sorry, this is a duplicate of #1723.
re-opening since I think if pydantic is included in one section, it should be "Data Validation", not "Built-in Classes Enhancement" as #1723 has it.
why was it added last when the rest of the entries in that section are sorted alphabetically?
I think this would be great, as I said on the original issue, it can start small - e.g. fields can only be set via named arguments like `--foo 123`.
I agree with @hramezani that this should be implemented as a separate Source. PR welcome.
The source should be off by default, that avoids any backwards compatibility issues. I'm not sure if you need sub-commands or shortened names initially, just populating a model from named...
See https://github.com/pydantic/pydantic-core/issues/266, might be partially related. Can you explain a bit more about what you want? With python >= 3.9, we could probably use the [`zoneinfo`](https://docs.python.org/3/library/zoneinfo.html) standard lib module, so...
So you just want to check a string represents a valid timezone? That seem pretty easy, but also pretty easy to implement as a custom type/validator. The more complex case...
Thanks! My actual use case was struct/class methods where I think there's the same overhead, but I don't know how to implement t them without `#[pyclass]`.