diff --git a/src/fsize/__init__.py b/src/fsize/__init__.py index 979bf95..a979244 100644 --- a/src/fsize/__init__.py +++ b/src/fsize/__init__.py @@ -37,13 +37,13 @@ import math import re -from typing import Any, Self +from typing import Any __all__ = ["FSize"] __version__ = "0.6.1" -_UNIT_POWERS: dict[str, int] = { +_UNIT_POWERS: "dict[str, int]" = { "B": 0, "K": 1, "M": 2, @@ -67,7 +67,7 @@ _MAX_FORMAT_WIDTH = 1000 -def _canonical_units(match: re.Match[str]) -> str: +def _canonical_units(match: "re.Match[str]") -> str: """Return the canonical spelling of units matched by _RE_UNITS. Args: @@ -90,7 +90,7 @@ class FSize(float): _convert: float - def __new__(cls, value: Any, units: str = "B") -> Self: + def __new__(cls, value: Any, units: str = "B") -> "FSize": """Create a new FSize instance. Create a new FSize instance, which is a subclass of float. The value is