new style typing

This commit is contained in:
Maxim Devaev 2022-09-04 17:12:56 +03:00
parent fb50eea526
commit 7f620c758f
2 changed files with 3 additions and 7 deletions

View File

@ -1,14 +1,12 @@
import os
from typing import List
from setuptools import Extension
from setuptools import setup
# =====
def _find_sources(suffix: str) -> List[str]:
sources: List[str] = []
def _find_sources(suffix: str) -> list[str]:
sources: list[str] = []
for (root_path, _, names) in os.walk("src"):
for name in names:
if name.endswith(suffix):

View File

@ -26,13 +26,11 @@ import os
import io
import struct
from typing import Tuple
import common
# =====
def _get_jpeg_size(data: bytes) -> Tuple[int, int]:
def _get_jpeg_size(data: bytes) -> tuple[int, int]:
# https://sheep.horse/2013/9/finding_the_dimensions_of_a_jpeg_file_in_python.html
stream = io.BytesIO(data)