Hello,
I hope you are well. I really like Pydantic, and I've found it makes it much easier and also neater to work with classes in python.
Today, I tried to use it to put the arguments parsed from the command line with argparse as an attribute in class to use composition. The exact type name is argparse.Namespace. Because this wasn't able to work, I just converted the arguments to a default dictionary type and used that with pedantic.
This works, but I think it would be much nicer to have the argparse type be able to work work pydantic classes by default, this way I can use the built-in functionality of that, rather than just using dictionary keys to get the arguments.
Would it be possible to add this?
Thanks!
Hello,
I hope you are well. I really like Pydantic, and I've found it makes it much easier and also neater to work with classes in python.
Today, I tried to use it to put the arguments parsed from the command line with argparse as an attribute in class to use composition. The exact type name is argparse.Namespace. Because this wasn't able to work, I just converted the arguments to a default dictionary type and used that with pedantic.
This works, but I think it would be much nicer to have the argparse type be able to work work pydantic classes by default, this way I can use the built-in functionality of that, rather than just using dictionary keys to get the arguments.
Would it be possible to add this?
Thanks!