Skip to content

Commit

Permalink
refactor(debugger): simplify PDBProtocol and remove unused protocol c…
Browse files Browse the repository at this point in the history
…lasses
  • Loading branch information
Alexandr Panteleev committed Feb 7, 2025
1 parent fee80dc commit 0dfd519
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions litestar/types/debugger_types.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,16 @@
from types import ModuleType, TracebackType
from typing import NoReturn, Optional, Protocol, Type, Union
from typing import Any, Optional, Protocol, Union

from typing_extensions import TypeAlias


class PDBProtocol(Protocol):
@staticmethod
def post_mortem(
t: Optional[TracebackType] = None,
) -> Optional[NoReturn]: ...


class IPDBProtocol(Protocol):
@staticmethod
def post_mortem(
tb: Optional[TracebackType] = None,
) -> Optional[NoReturn]: ...


class PDBRProtocol(Protocol):
@staticmethod
def post_mortem(
traceback: Optional[TracebackType] = None,
value: Optional[BaseException] = None,
) -> Optional[NoReturn]: ...


class PUDBProtocol(Protocol):
@staticmethod
def post_mortem(
tb: Optional[TracebackType] = None,
e_type: Optional[Type[BaseException]] = None,
e_value: Optional[BaseException] = None,
) -> Optional[NoReturn]: ...
*args: Any,
**kwargs: Any,
) -> Any: ...


Debugger: TypeAlias = Union[ModuleType, PDBProtocol, IPDBProtocol, PDBRProtocol, PUDBProtocol]
Debugger: TypeAlias = Union[ModuleType, PDBProtocol]

0 comments on commit 0dfd519

Please sign in to comment.