1 from typing import Callable, Tuple
4 __all__ = ("no_less_than",)
7 def no_less_than(base: str) -> Callable[[str], bool]:
8 def _no_less_than(base: str, what: str) -> bool:
10 tuple((int(el) for el in s.split("."))) for s in (base, what)
13 def __no_less_than(bl: Tuple[int, ...], wl: Tuple[int, ...]) -> bool:
14 if len(bl) == 0 and len(wl) == 0:
16 if (len(bl) == 0) != (len(wl) == 0):
17 return len(bl) < len(wl)
18 # At this point both lists are non-empty
20 return __no_less_than(bl[1:], wl[1:])
23 return __no_less_than(bl, wl)
25 return lambda arg: _no_less_than(base, arg)