From b64fdfc5842f9be9637887aff38b313a600e7bed Mon Sep 17 00:00:00 2001 From: toofar Date: Sun, 11 Sep 2022 12:26:39 +1200 Subject: mypy: ignore enum argument type: UrlFormattingOption The docs say: > The options from QUrl::ComponentFormattingOptions are also possible. > The FormattingOptions type is a typedef for QFlags. It stores an OR combination of UrlFormattingOption values. Maybe we should be should be definining out own types for some of the enums that include both the QFlag, enum and any child enums. --- qutebrowser/browser/browsertab.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index 29eb06e55..9c6c52e0e 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -1322,7 +1322,8 @@ class AbstractTab(QWidget): def __repr__(self) -> str: try: qurl = self.url() - url = qurl.toDisplayString(QUrl.ComponentFormattingOption.EncodeUnicode) + as_unicode = QUrl.ComponentFormattingOption.EncodeUnicode + url = qurl.toDisplayString(as_unicode) # type: ignore[arg-type] except (AttributeError, RuntimeError) as exc: url = '<{}>'.format(exc.__class__.__name__) else: -- cgit v1.2.3-54-g00ecf