1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-11-03 04:17:21 -05:00

Fix type hint for older py versions

This commit is contained in:
Ivan Habunek 2023-06-26 16:58:11 +02:00
parent 0662a7616b
commit 0c89445b61
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -4,6 +4,7 @@ import os
import re import re
import shutil import shutil
import subprocess import subprocess
from typing import List
import urwid import urwid
from datetime import datetime, timezone from datetime import datetime, timezone
@ -181,7 +182,7 @@ def get_max_toot_chars(instance, default=500):
return default return default
def deep_get(adict: dict, path: list[str], default=None): def deep_get(adict: dict, path: List[str], default=None):
return reduce( return reduce(
lambda d, key: d.get(key, default) if isinstance(d, dict) else default, lambda d, key: d.get(key, default) if isinstance(d, dict) else default,
path, path,