Skip to content

Use @unique to ensure and communicate enum uniqueness #2425

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

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/mock_vws/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
Constants used to make the VWS mock.
"""

from enum import Enum
from enum import Enum, unique

from beartype import beartype


@beartype
@unique
class ResultCodes(Enum):
"""Constants representing various VWS result codes.

Expand Down Expand Up @@ -42,6 +43,7 @@ class ResultCodes(Enum):


@beartype
@unique
class TargetStatuses(Enum):
"""Constants representing VWS target statuses.

Expand Down
3 changes: 2 additions & 1 deletion src/mock_vws/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
Vuforia database states.
"""

from enum import StrEnum, auto
from enum import StrEnum, auto, unique

from beartype import beartype


@beartype
@unique
class States(StrEnum):
"""
Constants representing various web service states.
Expand Down
Loading