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

Add TypeGuard to is_formatted_phone_number #297

Conversation

flaeppe
Copy link
Contributor

@flaeppe flaeppe commented Jul 4, 2024

I added an assert_type row since it seems that you are checking types with pytest-mypy-plugins but I figured using assert_type is probably preferable

@antonagestam
Copy link
Owner

Hmm, looks like something unrelated broke sized types badly, will look at it as soon as I have some time.

@antonagestam
Copy link
Owner

but I figured using assert_type is probably preferable

Yup, it didn't exist back then, much better 👍

This is probably a good idea, although the circular dependency between the type definition and its predicate bothers me just slightly. The TypeGuard function will also be an optimization over going through the isinstance interface though, so definitely seems like net positive.

@antonagestam
Copy link
Owner

antonagestam commented Sep 15, 2024

Found minimal reproduction of the test failures, it's not related so I am merging this as is. Thanks for the contribution! 🙏

#299

@antonagestam antonagestam merged commit 92962ea into antonagestam:main Sep 15, 2024
4 of 9 checks passed
@flaeppe flaeppe deleted the fix/type-guard-is-formatted-phone-number branch September 15, 2024 16:56
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.

2 participants