From fa99225b95df47aead771aa32d1cea625eb2343b Mon Sep 17 00:00:00 2001 From: A_D Date: Fri, 23 Dec 2022 17:56:44 +0200 Subject: [PATCH] myNotebook.py: Make platform check simpler Mypy does not appear to understand the `x in ...` format for this chech --- myNotebook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/myNotebook.py b/myNotebook.py index 1989141fd..30f95274a 100644 --- a/myNotebook.py +++ b/myNotebook.py @@ -76,7 +76,8 @@ class Label(tk.Label): """Custom tk.Label class to fix some display issues.""" def __init__(self, master: Optional[ttk.Frame] = None, **kw): - if sys.platform in ['darwin', 'win32']: + # This format chosen over `sys.platform in (...)` as mypy and friends dont understand that + if sys.platform == 'darwin' or sys.platform == 'win32': kw['foreground'] = kw.pop('foreground', PAGEFG) kw['background'] = kw.pop('background', PAGEBG) else: