# Path: h11/_util.py
# class LocalProtocolError(ProtocolError):
#     def _reraise_as_remote_protocol_error(self) -> NoReturn:
#         # After catching a LocalProtocolError, use this method to re-raise it
#         # as a RemoteProtocolError. This method must be called from inside an
#         # except: block.
#         #
#         # An easy way to get an equivalent RemoteProtocolError is just to
#         # modify 'self' in place.
#         self.__class__ = RemoteProtocolError  # type: ignore
#         # But the re-raising is somewhat non-trivial -- you might think that
#         # now that we've modified the in-flight exception object, that just
#         # doing 'raise' to re-raise it would be enough. But it turns out that
#         # this doesn't work, because Python tracks the exception type
#         # (exc_info[0]) separately from the exception object (exc_info[1]),
#         # and we only modified the latter. So we really do need to re-raise
#         # the new type explicitly.
#         # On py3, the traceback is part of the exception object, so our
#         # in-place modification preserved it and we can just re-raise:
#         raise self
# 
# class Sentinel(type):
#     def __new__(
#         cls: Type[_T_Sentinel],
#         name: str,
#         bases: Tuple[type, ...],
#         namespace: Dict[str, Any],
#         **kwds: Any
#     ) -> _T_Sentinel:
#         assert bases == (Sentinel,)
#         v = super().__new__(cls, name, bases, namespace, **kwds)
#         v.__class__ = v  # type: ignore
#         return v
# 
#     def __repr__(self) -> str:
#         return self.__name__


from typing import cast, Dict, Optional, Set, Tuple, Type, Union
from ._events import *
from ._util import LocalProtocolError, Sentinel
# States
class IDLE(Sentinel, metaclass=Sentinel):
    pass


class SEND_RESPONSE(Sentinel, metaclass=Sentinel):
    pass


class SEND_BODY(Sentinel, metaclass=Sentinel):
    pass


class DONE(Sentinel, metaclass=Sentinel):
    pass


class MUST_CLOSE(Sentinel, metaclass=Sentinel):
    pass


class CLOSED(Sentinel, metaclass=Sentinel):
    pass


class ERROR(Sentinel, metaclass=Sentinel):
    pass


# Switch types

# Path: h11/_util.py
# class LocalProtocolError(ProtocolError):
#     def _reraise_as_remote_protocol_error(self) -> NoReturn:
#         # After catching a LocalProtocolError, use this method to re-raise it
#         # as a RemoteProtocolError. This method must be called from inside an
#         # except: block.
#         #
#         # An easy way to get an equivalent RemoteProtocolError is just to
#         # modify 'self' in place.
#         self.__class__ = RemoteProtocolError  # type: ignore
#         # But the re-raising is somewhat non-trivial -- you might think that
#         # now that we've modified the in-flight exception object, that just
#         # doing 'raise' to re-raise it would be enough. But it turns out that
#         # this doesn't work, because Python tracks the exception type
#         # (exc_info[0]) separately from the exception object (exc_info[1]),
#         # and we only modified the latter. So we really do need to re-raise
#         # the new type explicitly.
#         # On py3, the traceback is part of the exception object, so our
#         # in-place modification preserved it and we can just re-raise:
#         raise self
# 
# class Sentinel(type):
#     def __new__(
#         cls: Type[_T_Sentinel],
#         name: str,
#         bases: Tuple[type, ...],
#         namespace: Dict[str, Any],
#         **kwds: Any
#     ) -> _T_Sentinel:
#         assert bases == (Sentinel,)
#         v = super().__new__(cls, name, bases, namespace, **kwds)
#         v.__class__ = v  # type: ignore
#         return v
# 
#     def __repr__(self) -> str:
#         return self.__name__


# Path: h11/_state.py
from typing import cast, Dict, Optional, Set, Tuple, Type, Union
from ._events import *
from ._util import LocalProtocolError, Sentinel

# States
class IDLE(Sentinel, metaclass=Sentinel):
    pass


class SEND_RESPONSE(Sentinel, metaclass=Sentinel):
    pass


class SEND_BODY(Sentinel, metaclass=Sentinel):
    pass


class DONE(Sentinel, metaclass=Sentinel):
    pass


class MUST_CLOSE(Sentinel, metaclass=Sentinel):
    pass


class CLOSED(Sentinel, metaclass=Sentinel):
    pass


class ERROR(Sentinel, metaclass=Sentinel):
    pass


# Switch types

class MIGHT_SWITCH_PROTOCOL(Sentinel, metaclass=Sentinel):