HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/referencing/_attrs.py
from __future__ import annotations

from typing import NoReturn, TypeVar

from attrs import define as _define, frozen as _frozen

_T = TypeVar("_T")


def define(cls: type[_T]) -> type[_T]:  # pragma: no cover
    cls.__init_subclass__ = _do_not_subclass
    return _define(cls)


def frozen(cls: type[_T]) -> type[_T]:
    cls.__init_subclass__ = _do_not_subclass
    return _frozen(cls)


class UnsupportedSubclassing(Exception):
    def __str__(self):
        return (
            "Subclassing is not part of referencing's public API. "
            "If no other suitable API exists for what you're trying to do, "
            "feel free to file an issue asking for one."
        )


@staticmethod
def _do_not_subclass() -> NoReturn:  # pragma: no cover
    raise UnsupportedSubclassing()