diff --git a/sentry_sdk/types.py b/sentry_sdk/types.py index f7397adee1..9a96ed489f 100644 --- a/sentry_sdk/types.py +++ b/sentry_sdk/types.py @@ -11,6 +11,11 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from sentry_sdk._types import Event, Hint # noqa: F401 + from sentry_sdk._types import Event, Hint +else: + # The lines below allow the types to be imported from outside `if TYPE_CHECKING` + # guards. The types in this module are only intended to be used for type hints. + Event = None + Hint = None - __all__ = ["Event", "Hint"] +__all__ = ("Event", "Hint")