Skip to content

Remove strict checking for validating tuples#8

Merged
qartik merged 2 commits intomainfrom
validate-tuples
Oct 20, 2023
Merged

Remove strict checking for validating tuples#8
qartik merged 2 commits intomainfrom
validate-tuples

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 Quantinuum/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
@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