Skip to content

PyQt6 stubs example with QtCore#160

Closed
TilmanK wants to merge 2 commits intopython-qt-tools:masterfrom
TilmanK:master
Closed

PyQt6 stubs example with QtCore#160
TilmanK wants to merge 2 commits intopython-qt-tools:masterfrom
TilmanK:master

Conversation

@TilmanK
Copy link
Contributor

@TilmanK TilmanK commented Jul 18, 2021

This is a follow-up PR for the discussion about PyQt6 here: #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:

  • 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 ;)

@TilmanK TilmanK closed this Aug 23, 2021
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