Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/fsize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand All @@ -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
Expand Down