"""
This module provides compatibility layers for older Python versions.
"""

from enum import Enum

try:
    from enum import StrEnum
except ImportError:

    class StrEnum(str, Enum):
        """
        Enum where members are also (and must be) strings.
        Backport for Python < 3.11.
        """

        def __str__(self):
            return str(self.value)


try:
    from typing import override
except ImportError:

    def override(func):
        """
        Decorator to indicate that a method overrides a method in a superclass.
        Backport for Python < 3.12.
        """
        return func
