Skip to content

Provide for setting NO_ITEM_VALIDATION at a function level #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
maread99 opened this issue Aug 24, 2023 · 0 comments
Open

Provide for setting NO_ITEM_VALIDATION at a function level #6

maread99 opened this issue Aug 24, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@maread99
Copy link
Owner

It's currently possible to skip validation of a container's items for a specific parameter (by including the NO_ITEM_VALIDATION constant to the Annotated metadata).

It would make sense to have a decorator argument to skip validation of container items for all parameters, for exmaple:

@parse(no_item_validation=True)
f(
    a: list[str]
    b: dict[str, int]
    c: tuple[str, ...]
):

Would have the same effect as:

@parse
f(
    a: Annotated[list[str], NO_ITEM_VALIDATION],
    b: Annotated[dict[str, int], NO_ITEM_VALIDATION],
    c: Annotated[tuple[str, ...], NO_ITEM_VALIDATION],
):

If you'd find this functionality useful, please give this comment a thumbs up. If you really want it, offer a comment.

@maread99 maread99 added the enhancement New feature or request label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant