-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Is your feature request related to a problem? Please describe.
In zod, when I validate an object or record, the returned value of the parse operation is strongly typed, with all the keys and types specified in the schema.
Describe the solution you'd like
I'd like record (and list) types to annotate the type that's the result of the validation, based on the schema.
At the moment it just shows the input type, so e.g. zon.element_list(zon.string()).validate([0]) should show list[str], but it actually shows list[int] right now. Obiously, the validation will either fail or return a list of strings.
Describe alternatives you've considered
I'm not sure if this is possible in python like that.
Additional context
I'm talking about this specifically in the context of type hints in vscode.
I'm kind of new to statically typed python, so not sure if this has to do with the extensions I installed.