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
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
sentry-python/sentry_sdk/consts.py
Line 1340 in a618e3a
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