Skip to content

ref: Explicit reexport of types (backport to 1.x)#2913

Merged
szokeasaurusrex merged 1 commit intomasterfrom
szokeasaurusrex/explicit-type-reexport
Mar 27, 2024
Merged

ref: Explicit reexport of types (backport to 1.x)#2913
szokeasaurusrex merged 1 commit intomasterfrom
szokeasaurusrex/explicit-type-reexport

Conversation

@szokeasaurusrex
Copy link
Copy Markdown
Member

@szokeasaurusrex szokeasaurusrex commented Mar 27, 2024

Explicitly reexport types to make strict mypy setups happy. This backports #2866 to 1.x.

Fixes GH-2910

* Explicitly reexport types to make strict mypy setups happy
@szokeasaurusrex szokeasaurusrex enabled auto-merge (squash) March 27, 2024 13:43
if TYPE_CHECKING:
from sentry_sdk._types import Event, Hint # noqa: F401

__all__ = ["Event", "Hint"]
Copy link
Copy Markdown
Contributor

@sentrivana sentrivana Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok that this is behind TYPE_CHECKING? Not too deep into the topic but #2909 seems to suggest it shouldn't be?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR only fixes #2910. I opened #2914 to fix #2909, and in #2914, I have moved the __all__ out of the if TYPE_CHECKING guard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exported types are not importable by mypy

3 participants