Skip to content

Provide for setting NO_ITEM_VALIDATION at a function level #6

@maread99

Description

@maread99

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions