cmp3 0.4.0__tar.gz → 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cmp3-0.4.0/src/cmp3.egg-info → cmp3-0.5.1}/PKG-INFO +1 -1
- {cmp3-0.4.0 → cmp3-0.5.1}/pyproject.toml +1 -1
- {cmp3-0.4.0 → cmp3-0.5.1}/src/cmp3/core/__init__.py +7 -8
- {cmp3-0.4.0 → cmp3-0.5.1/src/cmp3.egg-info}/PKG-INFO +1 -1
- {cmp3-0.4.0 → cmp3-0.5.1}/LICENSE.txt +0 -0
- {cmp3-0.4.0 → cmp3-0.5.1}/MANIFEST.in +0 -0
- {cmp3-0.4.0 → cmp3-0.5.1}/README.rst +0 -0
- {cmp3-0.4.0 → cmp3-0.5.1}/setup.cfg +0 -0
- {cmp3-0.4.0 → cmp3-0.5.1}/src/cmp3/__init__.py +0 -0
- {cmp3-0.4.0 → cmp3-0.5.1}/src/cmp3/tests/__init__.py +0 -0
- {cmp3-0.4.0 → cmp3-0.5.1}/src/cmp3/tests/test_1984.py +0 -0
- {cmp3-0.4.0 → cmp3-0.5.1}/src/cmp3.egg-info/SOURCES.txt +0 -0
- {cmp3-0.4.0 → cmp3-0.5.1}/src/cmp3.egg-info/dependency_links.txt +0 -0
- {cmp3-0.4.0 → cmp3-0.5.1}/src/cmp3.egg-info/requires.txt +0 -0
- {cmp3-0.4.0 → cmp3-0.5.1}/src/cmp3.egg-info/top_level.txt +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod
|
|
2
|
-
from functools import partial
|
|
3
2
|
from typing import *
|
|
4
3
|
|
|
5
4
|
import setdoc
|
|
6
5
|
|
|
7
|
-
__all__ = ["
|
|
6
|
+
__all__ = ["CmpABC", "cmpDeco"]
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
def
|
|
9
|
+
def cmpDeco(cls: type, /) -> type:
|
|
11
10
|
"This decorator enforces the use of __cmp__ upon a class."
|
|
12
11
|
|
|
13
12
|
@setdoc.basic
|
|
@@ -35,15 +34,15 @@ def comparable(cls: type, /) -> type:
|
|
|
35
34
|
return self.__cmp__(other).__ne__(0)
|
|
36
35
|
|
|
37
36
|
func: Callable
|
|
38
|
-
funcs:
|
|
39
|
-
funcs =
|
|
37
|
+
funcs: tuple[Callable, ...]
|
|
38
|
+
funcs = (
|
|
40
39
|
__eq__,
|
|
41
40
|
__ge__,
|
|
42
41
|
__gt__,
|
|
43
42
|
__le__,
|
|
44
43
|
__lt__,
|
|
45
44
|
__ne__,
|
|
46
|
-
|
|
45
|
+
)
|
|
47
46
|
for func in funcs:
|
|
48
47
|
setattr(cls, func.__name__, func)
|
|
49
48
|
try:
|
|
@@ -57,8 +56,8 @@ def comparable(cls: type, /) -> type:
|
|
|
57
56
|
return cls
|
|
58
57
|
|
|
59
58
|
|
|
60
|
-
@
|
|
61
|
-
class
|
|
59
|
+
@cmpDeco
|
|
60
|
+
class CmpABC(ABC):
|
|
62
61
|
__slots__ = ()
|
|
63
62
|
|
|
64
63
|
@abstractmethod
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|