aboutsummaryrefslogtreecommitdiff
path: root/thcolor/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'thcolor/utils.py')
-rw-r--r--thcolor/utils.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/thcolor/utils.py b/thcolor/utils.py
index 7d60d0c..337c794 100644
--- a/thcolor/utils.py
+++ b/thcolor/utils.py
@@ -3,7 +3,7 @@
# Copyright (C) 2022 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
# This file is part of the thcolor project, which is MIT-licensed.
# *****************************************************************************
-""" Utilities for the thcolor module. """
+"""Utilities for the thcolor module."""
from typing import Optional as _Optional
@@ -11,7 +11,7 @@ __all__ = ['factor', 'round_half_up']
def factor(x, max_: int = 100, clip: bool = False):
- """ Return a factor based on if something is a float or an int. """
+ """Return a factor based on if something is a float or an int."""
if isinstance(x, float):
pass
@@ -27,13 +27,13 @@ def factor(x, max_: int = 100, clip: bool = False):
def round_half_up(number: float, ndigits: _Optional[int] = None) -> float:
- """ Round a number to the nearest integer.
+ """Round a number to the nearest integer.
- This function exists because Python's built-in ``round`` function
- uses half-to-even rounding, also called "Banker's rounding".
- This means that 1.5 is rounded to 2 and 2.5 is also rounded to 2.
+ This function exists because Python's built-in ``round`` function
+ uses half-to-even rounding, also called "Banker's rounding".
+ This means that 1.5 is rounded to 2 and 2.5 is also rounded to 2.
- What we want is a half-to-up rounding, so we have this function.
+ What we want is a half-to-up rounding, so we have this function.
"""
if ndigits is None: