update black

This commit is contained in:
Will McGugan 2022-02-14 10:03:44 +00:00
parent 4639772763
commit 5dc797e1be
3 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ repos:
- id: rst-directive-colons - id: rst-directive-colons
- id: rst-inline-touching-normal - id: rst-inline-touching-normal
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 21.12b0 rev: 22.1.0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/PyCQA/isort - repo: https://github.com/PyCQA/isort

View File

@ -35,7 +35,7 @@ DIVIDES = [
(0, 1000000), (0, 1000000),
(3.1427, 2), (3.1427, 2),
(888, 0), (888, 0),
(2 ** 32, 2 ** 16), (2**32, 2**16),
] ]
divide_all(DIVIDES) divide_all(DIVIDES)

View File

@ -30,7 +30,7 @@ def _to_str(
return "{:,} bytes".format(size) return "{:,} bytes".format(size)
for i, suffix in enumerate(suffixes, 2): # noqa: B007 for i, suffix in enumerate(suffixes, 2): # noqa: B007
unit = base ** i unit = base**i
if size < unit: if size < unit:
break break
return "{:,.{precision}f}{separator}{}".format( return "{:,.{precision}f}{separator}{}".format(
@ -44,7 +44,7 @@ def _to_str(
def pick_unit_and_suffix(size: int, suffixes: List[str], base: int) -> Tuple[int, str]: def pick_unit_and_suffix(size: int, suffixes: List[str], base: int) -> Tuple[int, str]:
"""Pick a suffix and base for the given size.""" """Pick a suffix and base for the given size."""
for i, suffix in enumerate(suffixes): for i, suffix in enumerate(suffixes):
unit = base ** i unit = base**i
if size < unit * base: if size < unit * base:
break break
return unit, suffix return unit, suffix