This PR contains some adjustments to the lib, but most importantly the adapted pyi-File for QtCore. It's basically a merge between the upstream pyi-File and the current stubs (or more precisely, the fixes of the current stubs).
Here are some things that must be discussed:
To easily compare both files (current QtCore.pyi and upstream pyi) I ran with Black over both of them. The result is that there are a lot of differences between the current and the upstream pyi file. Shall I revert the changes by Black? Shouldn't be that much work.
The original stubs as well as "our" stubs aren't very clear what to do with bytes and QByteArray. Actually, the stubs define a Buffer (PyQt6.sip.Buffer) like this: Buffer = Union[bytes, bytearray, memoryview, array, voidptr], but don't use it a lot. What we use is typing.Union[QByteArray, bytes, bytearray]. The stubs use either a QByteArray, or typing.Union[QByteArray, bytes, bytearray, memoryview]. We should be consistent...
What's the point in using the type variable in QtCore.pyi:55 QObjectT?
I'm not sure if this is the right way to go forward with PyQt6 (@The-Compiler already said correctly that we could or should use some automation) - any feedback is highly appreciated. And if someone has a better way or is more experienced - go on and take over. I will just need the stubs in the end ;)
This is a follow-up PR for the discussion about PyQt6 here: https://github.com/python-qt-tools/PyQt5-stubs/issues/69
This PR contains some adjustments to the lib, but most importantly the adapted pyi-File for QtCore. It's basically a merge between the upstream pyi-File and the current stubs (or more precisely, the fixes of the current stubs).
Here are some things that must be discussed:
bytes
andQByteArray
. Actually, the stubs define a Buffer (PyQt6.sip.Buffer
) like this:Buffer = Union[bytes, bytearray, memoryview, array, voidptr]
, but don't use it a lot. What we use istyping.Union[QByteArray, bytes, bytearray]
. The stubs use either aQByteArray
, ortyping.Union[QByteArray, bytes, bytearray, memoryview]
. We should be consistent...QObjectT
?I'm not sure if this is the right way to go forward with PyQt6 (@The-Compiler already said correctly that we could or should use some automation) - any feedback is highly appreciated. And if someone has a better way or is more experienced - go on and take over. I will just need the stubs in the end ;)