Fix for Property, add explicit hint for signal in notify argument#15
Open
kaneryu wants to merge 1 commit intopython-qt-tools:mainfrom
Open
Fix for Property, add explicit hint for signal in notify argument#15kaneryu wants to merge 1 commit intopython-qt-tools:mainfrom
kaneryu wants to merge 1 commit intopython-qt-tools:mainfrom
Conversation
Author
Contributor
|
Hi, Thanks for the contribution. Could you also provide a simple example of failing code ? |
|
Hi! I'm experiencing this same issue. Here is a minimal example that shows this error: from PySide6.QtCore import QObject, Property, Signal
class Test(QObject):
testChanged = Signal()
def get_test(self) -> str:
return 'test'
def set_test(self, str) -> None:
pass
test = Property(str, get_test, set_test, notify=testChanged)mypy t.py
t.py:13: error: Argument "notify" to "Property" has incompatible type "Signal"; expected "Callable[..., Any] | None" [arg-type]
Found 1 error in 1 file (checked 1 source file) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.