Files
python-repositories/python_repositories/interfaces/context_aware_interface.py
T
Brian Bjarke Jensen 5d7afe7a6c
Code Quality Pipeline / code-quality (pull_request) Successful in 16s
Test Python Package / test (pull_request) Failing after 9s
ruff format corrections
2025-09-14 16:17:04 +02:00

22 lines
578 B
Python

"""Definition of ConnectionAwareInterface abstract base class."""
from __future__ import annotations
from abc import ABC, abstractmethod
class ContextAwareInterface(ABC):
"""Interface that defined context-related methods."""
@abstractmethod
def __enter__(self) -> ContextAwareInterface:
"""Enter the context."""
raise NotImplementedError()
@abstractmethod
def __exit__(
self, exc_type: type | None, exc_val: object | None, exc_tb: object | None
) -> None:
"""Exit the context."""
raise NotImplementedError()