Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyQt6 stubs example with QtCore #160

Closed
wants to merge 2 commits into from
Closed

PyQt6 stubs example with QtCore #160

wants to merge 2 commits into from

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