-
Notifications
You must be signed in to change notification settings - Fork 4
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
Using duck-typed signals (non-Qt) - can this cause problems? #94
Comments
On the topic of signal-alikes I'll mention that I happened to sneak a little one of my own in here. I probably shouldn't have but it's not public API presently. Lines 10 to 53 in 0178ef6
But... sure, type hinting could make PyCharm complain. I think the solutions are 'interfaces' (like via I'm game for an exploration of supporting this case nicely though. Hopefully it really is just a type hinting thing. Hmm... I suppose if you tried to chain both Qt and non-Qt signals there could be trouble. But I don't recall anything offhand in QTrio itself that should care. I think the following are the trickiest things being done and should at worst require you implementing a couple things to be ducky enough. Lines 94 to 137 in 0178ef6
Lines 56 to 85 in 0178ef6
I will note lastly here that you can use a |
Along with Qt
Signal
, I also use my own homegrown version which is api-compatible (connect/disconnect/emit), but does not use Qt code. Such signals are handy because some controllers can be used in a CLI-only applications (code reuse).Not being very familiar with type hints, just getting a bit worried. My understanding is that runtime nothing bad can happen. But maybe UI (PyCharm?) or static type checkers will flag errors?
Question: do you see any problem with duck-typed non-Qt signals?
The text was updated successfully, but these errors were encountered: