Closed tlambert03 closed 1 year ago
Patch coverage: 77.77%
and project coverage change: +0.02%
:tada:
Comparison is base (
dd9af3b
) 86.03% compared to head (2fc318f
) 86.06%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
the crux of the pyside code is here: https://github.com/pyside/pyside-setup/blob/10941bc37450f2fe99cd3afa4e2331df0439d162/sources/pyside6/libpyside/pysidesignal.cpp#L1209C2-L1213C20
basically, it looks at .__code__.co_argcount
and other __code__
attributes. I tried patching those directly (without using compile and exec), but wasn't able to do so. In any case, I'm not sure it would be any less black magic than the fix here.
I do think this is important functionality to retain though (the ability to add more signals later without breaking APIs is a very nice thing in Qt/psygnal, and this is currently breaking it)
thoughts?
linking https://github.com/pyapp-kit/psygnal/pull/228 here as well, since I suspect a similar phenomenon might be happening in psygnal too. basically, this will likely happen with any decorator that uses the pattern:
@wraps(func)
def inner(*args, **kwargs):
func(*args, **kwargs)
since Qt doesn't know that inner
has the same signature as func
fixes #182 ... and adds a test, but it sure isn't pretty at the moment :joy:
@Czaki, I'll keep playing with this (and digging into the qt source code) to see if I can come up with a more elegant way for Qt to be able to properly inspect the signature of a decorated wrapped function. but if you have any other ideas i should try, feel free to propose!
edit see also #185, which I think prefer now