Skip to content
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

Remove strict checking for validating tuples #8

Merged
merged 2 commits into from
Oct 20, 2023
Merged

Conversation

qartik
Copy link
Member

@qartik qartik commented Oct 19, 2023

Fixes #7
Also include docs in sdist
Sym: TypeAlias = str
Bit: TypeAlias = Annotated[list[Sym | Idx], Field(max_length=2)]
Idx = NewType("Idx", NonNegativeInt)
Bit = NewType("Bit", tuple[Sym, Idx])
Copy link
Member Author

@qartik qartik Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qciaran, @ss2165 turns out tuple validation is supported by pydantic, but at the cost of strict validation. 💯

qartik added a commit to CQCL/pytket-phir that referenced this pull request Oct 19, 2023
@qartik qartik requested a review from qciaran October 19, 2023 21:32
@qartik qartik merged commit f8e06c0 into main Oct 20, 2023
3 checks passed
@qartik qartik deleted the validate-tuples branch October 20, 2023 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more validation for implicit tuples such as Bit type
1 participant