-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed bug that results in a false negative if a |
union operator cr…
#9422
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…eates a union of generic types. These types should be specialized with default type arguments. This addresses #9415.
Diff from mypy_primer, showing the effect of this PR on open source code: ibis (https://github.com/ibis-project/ibis)
+ "Value" is not assignable to "StringValue"
- "Value" is not assignable to "StringValue"
+ Type "dict[str, Deferred]" is not assignable to type "(Value) -> Value"
- Type parameter "_KT@Mapping" is invariant, but "str" is not the same as "str | None"
+ Type parameter "_KT@Mapping" is invariant, but "str" is not the same as "str | None" (reportArgumentType)
- Type "dict[str, Deferred]" is not assignable to type "(Value) -> Value" (reportArgumentType)
+ Type "dict[str, Deferred]" is not assignable to type "(Value) -> Value"
- Type parameter "_KT@Mapping" is invariant, but "str" is not the same as "str | None"
+ Type parameter "_KT@Mapping" is invariant, but "str" is not the same as "str | None" (reportArgumentType)
- Type "dict[str, Deferred]" is not assignable to type "(Value) -> Value" (reportArgumentType)
+ Type "Value" is not assignable to type "(Value) -> Value"
- "Value" is not assignable to "Mapping[str | None, Deferred | ((Value) -> Value)]"
+ "Value" is not assignable to "Mapping[str | None, Deferred | ((Value) -> Value)]" (reportArgumentType)
- Type "Value" is not assignable to type "(Value) -> Value" (reportArgumentType)
+ Type "Value" is not assignable to type "(Value) -> Value"
- "Value" is not assignable to "Mapping[str | None, Deferred | ((Value) -> Value)]"
+ "Value" is not assignable to "Mapping[str | None, Deferred | ((Value) -> Value)]" (reportArgumentType)
- Type "Value" is not assignable to type "(Value) -> Value" (reportArgumentType)
- Type "Value" is not assignable to type "(Value, Value) -> Value"
+ Type "Value" is not assignable to type "(Value) -> Value"
- Type "Value" is not assignable to type "(Value) -> Value" (reportArgumentType)
+ Type "Value" is not assignable to type "(Value, Value) -> Value" (reportArgumentType)
- Type "Value" is not assignable to type "(Value, IntegerValue) -> (bool | BooleanValue)"
+ Type "Value" is not assignable to type "(Value) -> (bool | BooleanValue)"
- Type "Value" is not assignable to type "(Value) -> (bool | BooleanValue)" (reportArgumentType)
+ Type "Value" is not assignable to type "(Value, IntegerValue) -> (bool | BooleanValue)" (reportArgumentType)
bokeh (https://github.com/bokeh/bokeh)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/settings.py:216:26 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/core/property/container.py:294:30 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/model/util.py:207:39 - error: Second argument to "issubclass" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/models/sources.py:694:38 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/plotting/_figure.py:473:32 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/plotting/_figure.py:478:26 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/plotting/_figure.py:484:26 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/plotting/_stack.py
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/plotting/_stack.py:44:62 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/plotting/_stack.py:64:30 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/plotting/_stack.py:78:62 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/plotting/_stack.py:101:30 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/plotting/graph.py:143:26 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/plotting/graph.py:144:34 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/bokeh/src/bokeh/sphinxext/bokeh_palette.py:134:26 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
- 3547 errors, 294 warnings, 0 informations
+ 3561 errors, 294 warnings, 0 informations
core (https://github.com/home-assistant/core)
+ /tmp/mypy_primer/projects/core/homeassistant/helpers/template.py:2324:30 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
- 22487 errors, 323 warnings, 0 informations
+ 22488 errors, 323 warnings, 0 informations
mitmproxy (https://github.com/mitmproxy/mitmproxy)
- "None" is not assignable to "WebSocketMessage"
+ "None" is not assignable to "UDPMessage"
- "None" is not assignable to "UDPMessage" (reportArgumentType)
+ "None" is not assignable to "WebSocketMessage" (reportArgumentType)
- "None" is not assignable to "WebSocketMessage"
+ "None" is not assignable to "UDPMessage"
- "None" is not assignable to "UDPMessage" (reportArgumentType)
+ "None" is not assignable to "WebSocketMessage" (reportArgumentType)
- "None" is not assignable to "WebSocketMessage"
+ "None" is not assignable to "UDPMessage"
- "None" is not assignable to "UDPMessage" (reportArgumentType)
+ "None" is not assignable to "WebSocketMessage" (reportArgumentType)
zulip (https://github.com/zulip/zulip)
+ /tmp/mypy_primer/projects/zulip/zerver/lib/data_types.py:188:32 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
- 4864 errors, 461 warnings, 0 informations
+ 4865 errors, 461 warnings, 0 informations
xarray (https://github.com/pydata/xarray)
+ /tmp/mypy_primer/projects/xarray/xarray/core/dataarray.py:1442:33 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/xarray/xarray/core/dataset.py:2771:35 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/xarray/xarray/core/dataset.py:8639:34 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/xarray/xarray/core/dataset.py:8768:34 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/xarray/xarray/core/datatree_render.py
+ /tmp/mypy_primer/projects/xarray/xarray/core/datatree_render.py:252:37 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/xarray/xarray/core/indexes.py:533:27 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/xarray/xarray/core/utils.py:258:30 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/xarray/xarray/namedarray/core.py:813:31 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/xarray/xarray/plot/utils.py:129:25 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/xarray/xarray/plot/utils.py:940:25 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
+ /tmp/mypy_primer/projects/xarray/xarray/tests/test_units.py:166:26 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
- 2431 errors, 90 warnings, 0 informations
+ 2442 errors, 90 warnings, 0 informations
artigraph (https://github.com/artigraph/artigraph)
+ /tmp/mypy_primer/projects/artigraph/src/arti/internal/type_hints.py:148:26 - error: Second argument to "isinstance" must be a class or tuple of classes
+ Generic type with type arguments not allowed for instance or class checks (reportArgumentType)
- 155 errors, 4 warnings, 0 informations
+ 156 errors, 4 warnings, 0 informations
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…eates a union of generic types. These types should be specialized with default type arguments. This addresses #9415.