Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/validators/_extremes.py: 82%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""Extremes."""
3# standard
4from functools import total_ordering
5from typing import Any
8@total_ordering
9class AbsMax:
10 """An object that is greater than any other object (except itself).
12 Inspired by https://pypi.python.org/pypi/Extremes.
14 Examples:
15 >>> from sys import maxsize
16 >>> AbsMax() > AbsMin()
17 True
18 >>> AbsMax() > maxsize
19 True
20 >>> AbsMax() > 99999999999999999
21 True
22 """
24 def __ge__(self, other: Any):
25 """GreaterThanOrEqual."""
26 return other is not AbsMax
29@total_ordering
30class AbsMin:
31 """An object that is less than any other object (except itself).
33 Inspired by https://pypi.python.org/pypi/Extremes.
35 Examples:
36 >>> from sys import maxsize
37 >>> AbsMin() < -maxsize
38 True
39 >>> AbsMin() < None
40 True
41 >>> AbsMin() < ''
42 True
43 """
45 def __le__(self, other: Any):
46 """LessThanOrEqual."""
47 return other is not AbsMin