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

TypeGuard vs TypeIs #193

Closed
kreathon opened this issue Aug 13, 2024 · 1 comment
Closed

TypeGuard vs TypeIs #193

kreathon opened this issue Aug 13, 2024 · 1 comment

Comments

@kreathon
Copy link
Contributor

There is a proposed PEP 724 – Stricter Type Guards which may allow the is_ok and is_err type guards to work as expected in future versions of Python.

The linked PEP was withdrawn, however the same functionality was accepted as TypeIs.

It can be used starting from Python3.13, but there is also already a backport in typing_extensions. It is also already supported by type checkers like mypy.

I see two options for the project here:

  1. start using from Python3.13 on (as soon as (if ?) it is supported by result)
  2. already start using the backport for older Python versions

I would be happy to contribute (1. or 2).

@wbolster
Copy link
Member

both sound good!

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

No branches or pull requests

2 participants