From 633b123dcc7ac7d9204c473b503f8c0975d040a7 Mon Sep 17 00:00:00 2001 From: drnimbusrain Date: Thu, 13 Aug 2026 12:44:10 -0400 Subject: [PATCH] Add Python 3.6.8 code compatibility modifications --- src/fsize/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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