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:
parent
0662a7616b
commit
0c89445b61
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user