Skip to content

Commit

Permalink
Merge pull request #5 from MinionAttack/development
Browse files Browse the repository at this point in the history
SonarCloud.io
  • Loading branch information
MinionAttack committed Aug 24, 2023
2 parents 24c535e + f8275ff commit 009da12
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions utils/HumanBytes.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
""" Utility class to convert a number of bytes to a more readable format """

from typing import Union


# https://stackoverflow.com/a/63839503/3522933
class HumanBytes(object):
Expand All @@ -16,7 +14,7 @@ class HumanBytes(object):
PRECISION_FORMATS: list[str] = ["{}{:.0f} {}", "{}{:.1f} {}", "{}{:.2f} {}", "{}{:.3f} {}"]

@staticmethod
def format(num: Union[int, float], metric: bool = False, precision: int = 1) -> str:
def format(num: int | float, metric: bool = False, precision: int = 1) -> str:
"""
Human-readable formatting of bytes, using binary (powers of 1024) or metric (powers of 1000) representation
Expand Down

0 comments on commit 009da12

Please sign in to comment.