More reasonable signal emission of ListEdit and TupleEdit#499
More reasonable signal emission of ListEdit and TupleEdit#499tlambert03 merged 6 commits intopyapp-kit:mainfrom hanjinliu:main
ListEdit and TupleEdit#499Conversation
Codecov ReportBase: 89.98% // Head: 90.17% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #499 +/- ##
==========================================
+ Coverage 89.98% 90.17% +0.18%
==========================================
Files 32 32
Lines 4214 4232 +18
==========================================
+ Hits 3792 3816 +24
+ Misses 422 416 -6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
thanks @hanjinliu! Merging and will follow up on minor typing suggestions in another PR
| self._annotation = value | ||
| self._args_type = arg | ||
|
|
||
| def __iter__(self) -> Iterator[ValueWidget]: |
There was a problem hiding this comment.
Container is now Generic as of #475 ... so these aren't necessary anymore if we declare class ListEdit(Container[ValueWidget]) ... but I'll do that in a followup PR
| assert list_edit.value == [1, 2, 3, 3] | ||
| assert list_edit.data == [1, 2, 3, 3] | ||
| assert mock.call_count == 1 | ||
| mock.assert_called_with([1, 2, 3, 3]) |
|
Thank you! |
I found that
ListEditandTupleEditare emittingselfnow, and probably in wrong number of times (which may cause excessive number of function calls). This PR fixes these problems.This change might break backward compatibility if one uses
list_widget.changed.connect. Since they are supposed to be used as value-like widgets, they should emit their values just likeFileEdit, so this change should be applied eventually.