Use PEP 585 syntax wherever possible (#6717)

This commit is contained in:
Alex Waygood
2021-12-28 10:31:43 +00:00
committed by GitHub
parent e6cb341d94
commit 8d5d2520ac
237 changed files with 966 additions and 1069 deletions

View File

@@ -1,9 +1,9 @@
from typing import Any, Tuple
from typing import Any
from typing_extensions import Literal
_ImageFilter = Literal["AUTO", "FlateDecode", "DCTDecode", "JPXDecode"]
SUPPORTED_IMAGE_FILTERS: Tuple[_ImageFilter, ...]
SUPPORTED_IMAGE_FILTERS: tuple[_ImageFilter, ...]
def load_image(filename): ...

View File

@@ -1,5 +1,5 @@
from abc import ABC
from typing import Any, List
from typing import Any
def clear_empty_fields(d): ...
def create_dictionary_string(
@@ -29,7 +29,7 @@ def camel_case(property_name): ...
class PDFString(str):
def serialize(self): ...
class PDFArray(List[Any]):
class PDFArray(list[Any]):
def serialize(self): ...
class Destination(ABC):

View File

@@ -1,5 +1,5 @@
from collections.abc import Iterable
from typing import Any, Tuple
from typing import Any
from typing_extensions import Literal
_Unit = Literal["pt", "mm", "cm", "in"]
@@ -14,5 +14,5 @@ def convert_unit(
to_convert: float | Iterable[float | Iterable[Any]],
old_unit: str | float,
new_unit: str | float,
) -> float | Tuple[float, ...]: ...
) -> float | tuple[float, ...]: ...
def dochecks() -> None: ...