Conversation
…based on a type containing a pre-specified generic
…dency's sub-dependency
…addition Add python 3.13 to the supported versions
…based on a type containing a pre-specified generic
…ation-with-generics' into feature/restrict-handler-registration-with-generics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since there is a ton of complexity involved with supporting proper sub type checking for custom registered type sets, for now the plan is to block off the edge case until it becomes an issue.
For example, if I were to run the following:
I would get a TypeError because I gave Dict[str, int | str] as the type to register instead of just Dict.
Ideally in the future this would be perfectly fine and we just match based on whether the current base type + type args are a sub type of the key you provided, but it adds another layer to the issues we are having by taking the cartesian product of possibilities. This might not be as big of a problem down the line if the project can use maturin or if we can find a way to reduce the slow nature of pytest making tests with pytester in the tests for pytest-static. In short performance comes first and this is worth the sacrifice for the time being.