sentry_sdk.init(disable_integration=...) annotation incorrect · Issue #7460 · getsentry/sentry-python · GitHub
Skip to content

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

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

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.

already has the correct annotation.

Expected Result

mypy not complaining

Actual Result

mypy complains

Activity

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