Skip to content

Commit

Permalink
Switch to TypeIs
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanforbes committed Jul 2, 2024
1 parent f3d9196 commit b301c55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions erasmus/service_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import asyncio
import logging
from typing import TYPE_CHECKING, Any, Final, TypeGuard, cast
from typing import TYPE_CHECKING, Any, Final, cast

from attrs import field, frozen

Expand All @@ -14,6 +14,8 @@
)

if TYPE_CHECKING:
from typing_extensions import TypeIs

import aiohttp

from .config import Config
Expand All @@ -24,7 +26,7 @@
_log: Final = logging.getLogger(__name__)


def _is_service_cls(obj: object, /) -> TypeGuard[type[BaseService]]:
def _is_service_cls(obj: object, /) -> TypeIs[type[BaseService]]:
return hasattr(obj, 'from_config') and callable(cast(Any, obj).from_config)


Expand Down

0 comments on commit b301c55

Please sign in to comment.