-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
type-inferenceRequires more advanced type inference.Requires more advanced type inference.
Description
My test.py:
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from sentry_sdk._types import Event
from sentry_sdk._types import Hint
def before_send(event: Event, hint: Hint) -> Event | None:
passSteps to reproduce:
> ruff --select TCH test.py
test.py:4:35: TCH004 [*] Move import `sentry_sdk._types.Event` out of type-checking block. Import is used for more than type hinting.
test.py:5:35: TCH004 [*] Move import `sentry_sdk._types.Hint` out of type-checking block. Import is used for more than type hinting.
Found 2 errors.
[*] 2 potentially fixable with the --fix option.In this particular case, sentry_sdk only exports types if TYPE_CHECKING, so I cannot move this out of the type checking block.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type-inferenceRequires more advanced type inference.Requires more advanced type inference.