fix(python): use standard dict/list type annotation

Since Python 3.9 list/dict can be used as type hint.
This commit is contained in:
Jelle van der Waa 2022-07-31 20:58:39 +02:00 committed by Jelle van der Waa
parent 28970ccc91
commit a509e40474
31 changed files with 175 additions and 195 deletions

View file

@ -6,7 +6,7 @@ import string
from datetime import datetime
from http import HTTPStatus
from subprocess import PIPE, Popen
from typing import Callable, Iterable, List, Tuple, Union
from typing import Callable, Iterable, Tuple, Union
from urllib.parse import urlparse
import fastapi
@ -194,6 +194,6 @@ def parse_ssh_key(string: str) -> Tuple[str, str]:
return (prefix, key)
def parse_ssh_keys(string: str) -> List[Tuple[str, str]]:
def parse_ssh_keys(string: str) -> list[Tuple[str, str]]:
""" Parse a list of SSH public keys. """
return [parse_ssh_key(e) for e in string.splitlines()]