Use modern typehint syntax

This commit is contained in:
Lonami Exo
2024-03-17 13:06:03 +01:00
parent 9afe2f853d
commit 8267f5d590
72 changed files with 461 additions and 520 deletions

View File

@@ -7,12 +7,11 @@ import ast
import os
import re
from pathlib import Path
from typing import List
class ImportVisitor(ast.NodeVisitor):
def __init__(self) -> None:
self.imported_names: List[str] = []
self.imported_names: list[str] = []
def visit_ImportFrom(self, node: ast.ImportFrom) -> None:
if node.level == 1:
@@ -26,7 +25,7 @@ def main() -> None:
rf"(tl|mtproto){re.escape(os.path.sep)}(abcs|functions|types)"
)
files: List[str] = []
files: list[str] = []
for file in impl_root.rglob("__init__.py"):
file_str = str(file)
if autogenerated_re.search(file_str):