From cc5be8608b49d74a633b80a95a49a018d4dcd477 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 28 Aug 2022 22:29:06 +0200 Subject: Simplify the typing annotations --- libmat2/video.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libmat2/video.py') diff --git a/libmat2/video.py b/libmat2/video.py index ae9e463..1b38c77 100644 --- a/libmat2/video.py +++ b/libmat2/video.py @@ -3,7 +3,7 @@ import functools import shutil import logging -from typing import Dict, Union +from typing import Union from . import exiftool from . import bubblewrap @@ -12,7 +12,7 @@ from . import bubblewrap class AbstractFFmpegParser(exiftool.ExiftoolParser): """ Abstract parser for all FFmpeg-based ones, mainly for video. """ # Some fileformats have mandatory metadata fields - meta_key_value_allowlist = {} # type: Dict[str, Union[str, int]] + meta_key_value_allowlist = {} # type: dict[str, Union[str, int]] def remove_all(self) -> bool: if self.meta_key_value_allowlist: @@ -45,10 +45,10 @@ class AbstractFFmpegParser(exiftool.ExiftoolParser): return False return True - def get_meta(self) -> Dict[str, Union[str, dict]]: + def get_meta(self) -> dict[str, Union[str, dict]]: meta = super().get_meta() - ret = dict() # type: Dict[str, Union[str, dict]] + ret = dict() # type: dict[str, Union[str, dict]] for key, value in meta.items(): if key in self.meta_key_value_allowlist: if value == self.meta_key_value_allowlist[key]: -- cgit v1.3