cmp3 0.0.0.dev1__tar.gz → 0.1.0.dev1__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.0.0.dev1/src/cmp3.egg-info → cmp3-0.1.0.dev1}/PKG-INFO +3 -2
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1}/pyproject.toml +5 -3
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1}/src/cmp3/__init__.py +0 -3
- cmp3-0.1.0.dev1/src/cmp3/core/__init__.py +60 -0
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1/src/cmp3.egg-info}/PKG-INFO +3 -2
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1}/src/cmp3.egg-info/SOURCES.txt +1 -0
- cmp3-0.1.0.dev1/src/cmp3.egg-info/requires.txt +1 -0
- cmp3-0.0.0.dev1/src/cmp3/core/__init__.py +0 -8
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1}/LICENSE.txt +0 -0
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1}/MANIFEST.in +0 -0
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1}/README.rst +0 -0
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1}/setup.cfg +0 -0
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1}/src/cmp3/tests/__init__.py +0 -0
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1}/src/cmp3/tests/test_1984.py +0 -0
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1}/src/cmp3.egg-info/dependency_links.txt +0 -0
- {cmp3-0.0.0.dev1 → cmp3-0.1.0.dev1}/src/cmp3.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cmp3
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1.0.dev1
|
|
4
4
|
Summary: This project updates the concept of __cmp__ for python3.
|
|
5
5
|
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
@@ -28,7 +28,7 @@ Project-URL: Download, https://pypi.org/project/cmp3/#files
|
|
|
28
28
|
Project-URL: Index, https://pypi.org/project/cmp3/
|
|
29
29
|
Project-URL: Source, https://github.com/johannes-programming/cmp3/
|
|
30
30
|
Project-URL: Website, https://cmp3.johannes-programming.online/
|
|
31
|
-
Classifier: Development Status ::
|
|
31
|
+
Classifier: Development Status :: 3 - Alpha
|
|
32
32
|
Classifier: License :: OSI Approved :: MIT License
|
|
33
33
|
Classifier: Natural Language :: English
|
|
34
34
|
Classifier: Operating System :: OS Independent
|
|
@@ -39,6 +39,7 @@ Classifier: Typing :: Typed
|
|
|
39
39
|
Requires-Python: >=3.11
|
|
40
40
|
Description-Content-Type: text/x-rst
|
|
41
41
|
License-File: LICENSE.txt
|
|
42
|
+
Requires-Dist: setdoc<2,>=1.2.6
|
|
42
43
|
Dynamic: license-file
|
|
43
44
|
|
|
44
45
|
====
|
|
@@ -9,7 +9,7 @@ authors = [
|
|
|
9
9
|
{ email = "johannes.programming@gmail.com", name = "Johannes" },
|
|
10
10
|
]
|
|
11
11
|
classifiers = [
|
|
12
|
-
"Development Status ::
|
|
12
|
+
"Development Status :: 3 - Alpha",
|
|
13
13
|
"License :: OSI Approved :: MIT License",
|
|
14
14
|
"Natural Language :: English",
|
|
15
15
|
"Operating System :: OS Independent",
|
|
@@ -18,13 +18,15 @@ classifiers = [
|
|
|
18
18
|
"Programming Language :: Python :: 3 :: Only",
|
|
19
19
|
"Typing :: Typed",
|
|
20
20
|
]
|
|
21
|
-
dependencies = [
|
|
21
|
+
dependencies = [
|
|
22
|
+
"setdoc>=1.2.6,<2",
|
|
23
|
+
]
|
|
22
24
|
description = "This project updates the concept of __cmp__ for python3."
|
|
23
25
|
keywords = []
|
|
24
26
|
name = "cmp3"
|
|
25
27
|
readme = "README.rst"
|
|
26
28
|
requires-python = ">=3.11"
|
|
27
|
-
version = "0.
|
|
29
|
+
version = "0.1.0.dev1"
|
|
28
30
|
|
|
29
31
|
[project.license]
|
|
30
32
|
file = "LICENSE.txt"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from functools import partial
|
|
3
|
+
from typing import *
|
|
4
|
+
|
|
5
|
+
import setdoc
|
|
6
|
+
|
|
7
|
+
__all__ = ["Comparable", "comparable"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def comparable(*, overwrite: Any = False) -> type:
|
|
11
|
+
return partial(update, overwrite=overwrite)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def update(cls: type, /, *, overwrite: Any = False) -> type:
|
|
15
|
+
@setdoc.basic
|
|
16
|
+
def __eq__(self: Self, other: Any) -> bool:
|
|
17
|
+
return self.__cmp__(other) == 0
|
|
18
|
+
|
|
19
|
+
@setdoc.basic
|
|
20
|
+
def __ge__(self: Self, other: Any) -> bool:
|
|
21
|
+
return self.__cmp__(other) >= 0
|
|
22
|
+
|
|
23
|
+
@setdoc.basic
|
|
24
|
+
def __gt__(self: Self, other: Any) -> bool:
|
|
25
|
+
return self.__cmp__(other) > 0
|
|
26
|
+
|
|
27
|
+
@setdoc.basic
|
|
28
|
+
def __le__(self: Self, other: Any) -> bool:
|
|
29
|
+
return self.__cmp__(other) <= 0
|
|
30
|
+
|
|
31
|
+
@setdoc.basic
|
|
32
|
+
def __lt__(self: Self, other: Any) -> bool:
|
|
33
|
+
return self.__cmp__(other) < 0
|
|
34
|
+
|
|
35
|
+
@setdoc.basic
|
|
36
|
+
def __ne__(self: Self, other: Any) -> bool:
|
|
37
|
+
return self.__cmp__(other) != 0
|
|
38
|
+
|
|
39
|
+
func: Callable
|
|
40
|
+
funcs: list[Callable]
|
|
41
|
+
funcs = [
|
|
42
|
+
__eq__,
|
|
43
|
+
__ge__,
|
|
44
|
+
__gt__,
|
|
45
|
+
__le__,
|
|
46
|
+
__lt__,
|
|
47
|
+
__ne__,
|
|
48
|
+
]
|
|
49
|
+
for func in funcs:
|
|
50
|
+
if overwrite or not hasattr(cls, func.__name__):
|
|
51
|
+
setattr(cls, func.__name__, func)
|
|
52
|
+
return cls
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@comparable()
|
|
56
|
+
class Comparable(ABC):
|
|
57
|
+
__slots__ = ()
|
|
58
|
+
|
|
59
|
+
@abstractmethod
|
|
60
|
+
def __cmp__(self: Self, other: Any) -> Any: ...
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cmp3
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1.0.dev1
|
|
4
4
|
Summary: This project updates the concept of __cmp__ for python3.
|
|
5
5
|
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
@@ -28,7 +28,7 @@ Project-URL: Download, https://pypi.org/project/cmp3/#files
|
|
|
28
28
|
Project-URL: Index, https://pypi.org/project/cmp3/
|
|
29
29
|
Project-URL: Source, https://github.com/johannes-programming/cmp3/
|
|
30
30
|
Project-URL: Website, https://cmp3.johannes-programming.online/
|
|
31
|
-
Classifier: Development Status ::
|
|
31
|
+
Classifier: Development Status :: 3 - Alpha
|
|
32
32
|
Classifier: License :: OSI Approved :: MIT License
|
|
33
33
|
Classifier: Natural Language :: English
|
|
34
34
|
Classifier: Operating System :: OS Independent
|
|
@@ -39,6 +39,7 @@ Classifier: Typing :: Typed
|
|
|
39
39
|
Requires-Python: >=3.11
|
|
40
40
|
Description-Content-Type: text/x-rst
|
|
41
41
|
License-File: LICENSE.txt
|
|
42
|
+
Requires-Dist: setdoc<2,>=1.2.6
|
|
42
43
|
Dynamic: license-file
|
|
43
44
|
|
|
44
45
|
====
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
setdoc<2,>=1.2.6
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|