Skip to content

Commit

Permalink
Mypy has been updated to 1.1.1 from 1.0.1 and it now differentiates b…
Browse files Browse the repository at this point in the history
…etween types of `assignment`, requiring us to use the specialised `method-assign` ignore case
  • Loading branch information
rt121212121 committed Mar 7, 2023
1 parent 6c1238a commit f046e0d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions electrumsv/gui/qt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ def _create_window_for_wallet(self, wallet: Wallet) -> ElectrumWindow:

def _register_wallet_events(self, wallet: Wallet) -> None:
# NOTE(typing) Some typing nonsense about not being able to assign to a method.
wallet.contacts._on_contact_added = self._on_contact_added # type: ignore[assignment]
wallet.contacts._on_contact_removed = self._on_contact_removed # type: ignore[assignment]
wallet.contacts._on_identity_added = self._on_identity_added # type: ignore[assignment]
wallet.contacts._on_identity_removed = self._on_identity_removed # type: ignore[assignment]
wallet.contacts._on_contact_added = self._on_contact_added # type: ignore[method-assign]
wallet.contacts._on_contact_removed = self._on_contact_removed # type: ignore[method-assign]
wallet.contacts._on_identity_added = self._on_identity_added # type: ignore[method-assign]
wallet.contacts._on_identity_removed=self._on_identity_removed # type: ignore[method-assign]

def _on_identity_added(self, contact: ContactEntry, identity: ContactIdentity) -> None:
self.identity_added_signal.emit(contact, identity)
Expand Down
2 changes: 1 addition & 1 deletion electrumsv/gui/qt/key_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __init__(self, main_window: ElectrumWindow, account_id: int, key_data: KeyDa
self._history_list = history_list.HistoryList(self._main_window, self._main_window)
self._history_list._on_account_change(self._account_id, self._account, False)
# NOTE(typing) I have no idea why we are suddenly getting "Cannot assign to a method"
self._history_list.get_domain = self.get_domain # type: ignore[assignment]
self._history_list.get_domain = self.get_domain # type: ignore[method-assign]
vbox.addWidget(self._history_list)

vbox.addLayout(Buttons(CloseButton(self)))
Expand Down
2 changes: 1 addition & 1 deletion electrumsv/gui/qt/password_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(self, text: str='') -> None:
# Pass-throughs
self.key_event_signal = self.pw.key_event_signal
self.returnPressed = self.pw.returnPressed
self.setFocus = self.pw.setFocus # type: ignore[assignment]
self.setFocus = self.pw.setFocus # type: ignore[method-assign]
self.setMaxLength = self.pw.setMaxLength
self.setPlaceholderText = self.pw.setPlaceholderText
self.setText = self.pw.setText
Expand Down
2 changes: 1 addition & 1 deletion electrumsv/gui/qt/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ class ButtonsTextEdit(QPlainTextEdit, ButtonsWidget):
def __init__(self, text: Optional[str]=None) -> None:
QPlainTextEdit.__init__(self, text)
self.setText = self.setPlainText
self.text = self.toPlainText # type: ignore[assignment]
self.text = self.toPlainText # type: ignore[method-assign]
self.buttons: List[QAbstractButton] = []

def resizeEvent(self, event: QResizeEvent) -> None:
Expand Down

0 comments on commit f046e0d

Please sign in to comment.