Skip to content

sentry_sdk.init(disable_integration=...) annotation incorrect #7460

Closed
Dmao233/sentry-python
#1

Description

@jap

How do you use Sentry?

Self-hosted/on-premise

Version

the latest

Steps to Reproduce

We're running code which disables an integration by calling

sentry.init(
    ...,
    disabled_integrations=[sentry_sdk.integrations.falcon.FalconIntegration]
)

and mypy (rightfully) complains about this:

error: List item 0 has incompatible type "type[FalconIntegration]"; expected "Integration"  [list-item]

The annotation in

disabled_integrations: "Optional[Sequence[sentry_sdk.integrations.Integration]]" = None,
should be fixed to allow Optional[Sequence[Integration | type[Integration]] instead. Not sure if anyone passes Integration in directly here - I don't expect those integrations to be singletons - so maybe just type[Integration] suffices as well.

disabled_integrations: "Optional[Sequence[Union[type[Integration], Integration]]]" = None,
already has the correct annotation.

Expected Result

mypy not complaining

Actual Result

mypy complains

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Sep 10, 2026
  2. linear-code commented on Sep 10, 2026

    @linear-code
  3. alexander-alderman-webb commented on Sep 10, 2026

    @alexander-alderman-webb
    Collaborator

    Thanks you're correct, we'll fix

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Sep 10, 2026
  5. self-assigned this
    on Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions