-
What language is this for?
Python -
Which rule?
S6542 -
Why do you believe it’s a false-positive/false-negative?
Because as a user of mypy/pyright, one does not have a choice other than to useAny
-
SonarLint v4.1.0 in VS Code
-
How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)
pip install PySide6-Essentials==6.6.0
Image we want to override QComboBox.addItem
:
from typing import Any, overload, override
from PySide6.QtGui import QIcon, QPixmap
from PySide6.QtWidgets import QComboBox
class Class(QComboBox):
@overload
def addItem(self, icon: QIcon | QPixmap, text: str, userData: Any = ...) -> None:
...
@overload
def addItem(self, text: str, data: Any = ...) -> None:
...
@override
def addItem(self, *args: Any, **kwargs: Any) -> None:
super().addItem(*args, **kwargs)
# do something special
This triggers a total of 4 false-positive IMHO.