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 https://github.com/getsentry/sentry-python/blob/a618e3a3df9a7b1bbb09d38f1b38fbd5876df622/sentry_sdk/consts.py#L1340should 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
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
and mypy (rightfully) complains about this:
The annotation in https://github.com/getsentry/sentry-python/blob/a618e3a3df9a7b1bbb09d38f1b38fbd5876df622/sentry_sdk/consts.py#L1340should 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.sentry-python/sentry_sdk/integrations/__init__.py
Line 185 in a618e3a
Expected Result
mypy not complaining
Actual Result
mypy complains