# Copyright 2026 European Union
# Author: Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu)
# SPDX-License-Identifier: EUPL-1.2
"""
Legacy models module for radioviz application.
This module provides legacy model definitions, It serves
as a compatibility layer for older code structures while maintaining
backward compatibility with existing implementations.
"""
from enum import Enum
[docs]
class StrEnum(str, Enum):
"""
String enumeration base class that ensures string representation.
This class extends both `str` and `Enum` to create enumerations
that behave like strings while maintaining the benefits of enums.
It's particularly useful for creating named constants that need
to be used as strings in various contexts.
To be used for python version before 3.11 where StrEnum was not defined.
"""
def __str__(self) -> str:
"""
Return string representation of the enum value.
:return: String representation of the enum value
:rtype: str
"""
return str(self.value)