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

Make ErrorType a proper Enum #1612

Merged
merged 1 commit into from
Nov 7, 2024
Merged

Conversation

cdce8p
Copy link
Contributor

@cdce8p cdce8p commented Nov 3, 2024

Make ErrorType inherit from Enum. With this change mypy will infer the following

from av.error import ErrorType

reveal_type(ErrorType)                # def (value: object) -> av.error.ErrorType
reveal_type(ErrorType.BSF_NOT_FOUND)  # Literal[ErrorType.BSF_NOT_FOUND]
reveal_type(ErrorType.BSF_NOT_FOUND.name)   # str
reveal_type(ErrorType.BSF_NOT_FOUND.value)  # int
reveal_type(ErrorType.BSF_NOT_FOUND.__reduce__())  # tuple[Callable[[str, str, str], EnumItem], tuple[str, str, str]]

@cdce8p cdce8p force-pushed the ffmpeg-error-type branch from dadf68c to 83acf9f Compare November 3, 2024 11:29
@WyattBlue WyattBlue merged commit 0564862 into PyAV-Org:main Nov 7, 2024
8 checks passed
@cdce8p cdce8p deleted the ffmpeg-error-type branch November 7, 2024 23:08
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