Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/validators/_extremes.py: 80%
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 maxint
16 >>> AbsMax > AbsMin
17 # Output: True
18 >>> AbsMax > maxint
19 # Output: True
20 >>> AbsMax > 99999999999999999
21 # Output: 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 maxint
37 >>> AbsMin < -maxint
38 # Output: True
39 >>> AbsMin < None
40 # Output: True
41 >>> AbsMin < ''
42 # Output: True
43 """
45 def __le__(self, other: Any):
46 """LessThanOrEqual."""
47 return other is not AbsMin