-
Bug
-
Resolution: Incomplete
-
P3: Somewhat important
-
None
-
6.9.2
-
None
QByteArray.data() is incorrectly type hinted.
As far as I can tell, QByteArray.data in python can only return a bytes object.
The return type hint should reflect this.
Current (incorrect) type hint
def data(self, /) -> bytes | bytearray | memoryview: ...
Correct type hint
def data(self, /) -> bytes: ...
As discussed in the comments, other classes may handle conversion from C++ to Python differently.
As far as I can tell nothing inherits QByteArray so there is no reason to have a broader return type than the implementation.