Skip to content
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 a bug that results in a false negative when a class is used in … #9438

Merged
merged 1 commit into from
Nov 10, 2024

Conversation

erictraut
Copy link
Collaborator

…a type annotation for a method parameter and both the class and the method are generic and use PEP 695 syntax. This addresses #9382.

…a type annotation for a method parameter and both the class and the method are generic and use PEP 695 syntax. This addresses #9382.
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

core (https://github.com/home-assistant/core)
-   /tmp/mypy_primer/projects/core/homeassistant/components/xiaomi_ble/binary_sensor.py:151:46 - error: Argument of type "XiaomiPassiveBluetoothDataProcessor[bool | None]" cannot be assigned to parameter "processor" of type "PassiveBluetoothDataProcessor[Any, Module("xiaomi_ble")]" in function "async_register_processor"
-     "XiaomiPassiveBluetoothDataProcessor[bool | None]" is not assignable to "PassiveBluetoothDataProcessor[Any, Module("xiaomi_ble")]"
-       Type parameter "_DataT@PassiveBluetoothDataProcessor" is invariant, but "Module("xiaomi_ble")" is not the same as "Module("xiaomi_ble")" (reportArgumentType)
-   /tmp/mypy_primer/projects/core/homeassistant/components/xiaomi_ble/sensor.py:224:46 - error: Argument of type "XiaomiPassiveBluetoothDataProcessor[float | None]" cannot be assigned to parameter "processor" of type "PassiveBluetoothDataProcessor[Any, Module("xiaomi_ble")]" in function "async_register_processor"
-     "XiaomiPassiveBluetoothDataProcessor[float | None]" is not assignable to "PassiveBluetoothDataProcessor[Any, Module("xiaomi_ble")]"
-       Type parameter "_DataT@PassiveBluetoothDataProcessor" is invariant, but "Module("xiaomi_ble")" is not the same as "Module("xiaomi_ble")" (reportArgumentType)
- 22515 errors, 321 warnings, 0 informations 
+ 22513 errors, 321 warnings, 0 informations 

@erictraut erictraut merged commit 294b7af into main Nov 10, 2024
18 checks passed
@erictraut erictraut deleted the issue-9382 branch November 10, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant