Details
Description
In QtCore.pyi, in the QFileInfo class declaration:
@typing.overload @staticmethod def exists() -> bool: ... @typing.overload @staticmethod def exists(file:str) -> bool: ...
The first method is not static. So when we call the function like this:
fi = QFileInfo(__file__) if fi.exists(): print(__file__ + " exists !")
mypy reports an error:
test.py:5: error: Attribute function "exists" with type "Callable[[], bool]" does not accept self argument Found 1 error in 1 file (checked 1 source file)
when I put self in the arguments of the first function, mypy doesn't complain.
Attachments
Issue Links
- relates to
-
PYSIDE-1396 Making methods static that don't need self crashes 5.15.1
- Closed
For Gerrit Dashboard: PYSIDE-1328 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
310946,2 | signature: pass `self` directly from parser | 5.15 | pyside/pyside-setup | Status: MERGED | +2 | 0 |