From 3877917c6373edac38628bdd1a2272be3cb155c0 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Tue, 26 Jan 2021 10:18:04 -0800 Subject: [PATCH] Playlist snapshots: annotate snapshot record map. Re #155. Mypy: without annotating snapshot record map inside playlist snapshots method, Mypy will complain about assignment expression issues with type mismatch. Therefore annotate the map itself. --- addon/appModules/splstudio/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addon/appModules/splstudio/__init__.py b/addon/appModules/splstudio/__init__.py index 9f18d79b1..170603c65 100644 --- a/addon/appModules/splstudio/__init__.py +++ b/addon/appModules/splstudio/__init__.py @@ -1902,7 +1902,8 @@ def playlistSnapshots(self, obj: Any, end: Any, snapshotFlags: Optional[list[str # #55 (18.05): is this a complete snapshot? completePlaylistSnapshot = obj.IAccessibleChildID == 1 and end is None # Track count and total duration are always included. - snapshot = {} + # #155 (21.03): annotate snapshot map to avoid type annotation issues when assigning key/value pairs. + snapshot: dict[str, Any] = {} if snapshotFlags is None: snapshotFlags = [ flag for flag in splconfig.SPLConfig["PlaylistSnapshots"]