Skip to content

Commit 018c274

Browse files
committed
Remove eager typing import and redundant typing test
1 parent a2ff89c commit 018c274

2 files changed

Lines changed: 0 additions & 32 deletions

File tree

‎src/humanize/number.py‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
__lazy_modules__ = {"bisect"}
66

77
import bisect
8-
from typing import overload
98

109
from .i18n import _gettext as _
1110
from .i18n import _gettext_noop as N_
@@ -459,28 +458,6 @@ def scientific(value: NumberOrString, precision: int = 2) -> str:
459458
return part1 + " x 10" + str(int(part2)).translate(_SUPERSCRIPT_TRANS)
460459

461460

462-
@overload
463-
def clamp(
464-
value: None,
465-
format: str | Callable[[float], str] = "{:}",
466-
floor: float | None = None,
467-
ceil: float | None = None,
468-
floor_token: str = "<",
469-
ceil_token: str = ">",
470-
) -> None: ...
471-
472-
473-
@overload
474-
def clamp(
475-
value: float,
476-
format: str | Callable[[float], str] = "{:}",
477-
floor: float | None = None,
478-
ceil: float | None = None,
479-
floor_token: str = "<",
480-
ceil_token: str = ">",
481-
) -> str: ...
482-
483-
484461
def clamp(
485462
value: float | None,
486463
format: str | Callable[[float], str] = "{:}",

‎tests/test_number.py‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,6 @@ def test_clamp(test_args: list[typing.Any], expected: str) -> None:
297297
assert humanize.clamp(*test_args) == expected
298298

299299

300-
def test_clamp_return_types() -> None:
301-
assert typing.assert_type(humanize.clamp(1.0), str) == "1.0"
302-
assert typing.assert_type(humanize.clamp(None), None) is None
303-
assert (
304-
typing.assert_type(humanize.clamp(1, format=humanize.intword, floor=1e6), str)
305-
== "<1.0 million"
306-
)
307-
308-
309300
@pytest.mark.parametrize(
310301
"test_args, expected",
311302
[

0 commit comments

Comments
 (0)