cmp3 0.3.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.3.1/LICENSE.txt +21 -0
- cmp3-0.3.1/MANIFEST.in +1 -0
- cmp3-0.3.1/PKG-INFO +49 -0
- cmp3-0.3.1/README.rst +5 -0
- cmp3-0.3.1/pyproject.toml +38 -0
- cmp3-0.3.1/setup.cfg +4 -0
- cmp3-0.3.1/src/cmp3/__init__.py +2 -0
- cmp3-0.3.1/src/cmp3/core/__init__.py +70 -0
- cmp3-0.3.1/src/cmp3/tests/__init__.py +16 -0
- cmp3-0.3.1/src/cmp3/tests/test_1984.py +11 -0
- cmp3-0.3.1/src/cmp3.egg-info/PKG-INFO +49 -0
- cmp3-0.3.1/src/cmp3.egg-info/SOURCES.txt +14 -0
- cmp3-0.3.1/src/cmp3.egg-info/dependency_links.txt +1 -0
- cmp3-0.3.1/src/cmp3.egg-info/requires.txt +1 -0
- cmp3-0.3.1/src/cmp3.egg-info/top_level.txt +1 -0
cmp3-0.3.1/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Johannes
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
cmp3-0.3.1/MANIFEST.in
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
recursive-include src/cmp3 *.toml
|
cmp3-0.3.1/PKG-INFO
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cmp3
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: This project updates the concept of __cmp__ for python3.
|
|
5
|
+
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
|
+
License: The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Johannes
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
Project-URL: Download, https://pypi.org/project/cmp3/#files
|
|
28
|
+
Project-URL: Index, https://pypi.org/project/cmp3/
|
|
29
|
+
Project-URL: Source, https://github.com/johannes-programming/cmp3/
|
|
30
|
+
Project-URL: Website, https://cmp3.johannes-programming.online/
|
|
31
|
+
Classifier: Development Status :: 3 - Alpha
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Natural Language :: English
|
|
34
|
+
Classifier: Operating System :: OS Independent
|
|
35
|
+
Classifier: Programming Language :: Python
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
38
|
+
Classifier: Typing :: Typed
|
|
39
|
+
Requires-Python: >=3.11
|
|
40
|
+
Description-Content-Type: text/x-rst
|
|
41
|
+
License-File: LICENSE.txt
|
|
42
|
+
Requires-Dist: setdoc<2,>=1.2.6
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
====
|
|
46
|
+
cmp3
|
|
47
|
+
====
|
|
48
|
+
|
|
49
|
+
Visit the website `https://cmp3.johannes-programming.online/ <https://cmp3.johannes-programming.online/>`_ for more information.
|
cmp3-0.3.1/README.rst
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
build-backend = "setuptools.build_meta"
|
|
3
|
+
requires = [
|
|
4
|
+
"setuptools>=64.0",
|
|
5
|
+
]
|
|
6
|
+
|
|
7
|
+
[project]
|
|
8
|
+
authors = [
|
|
9
|
+
{ email = "johannes.programming@gmail.com", name = "Johannes" },
|
|
10
|
+
]
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 3 - Alpha",
|
|
13
|
+
"License :: OSI Approved :: MIT License",
|
|
14
|
+
"Natural Language :: English",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
"Programming Language :: Python",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
19
|
+
"Typing :: Typed",
|
|
20
|
+
]
|
|
21
|
+
dependencies = [
|
|
22
|
+
"setdoc>=1.2.6,<2",
|
|
23
|
+
]
|
|
24
|
+
description = "This project updates the concept of __cmp__ for python3."
|
|
25
|
+
keywords = []
|
|
26
|
+
name = "cmp3"
|
|
27
|
+
readme = "README.rst"
|
|
28
|
+
requires-python = ">=3.11"
|
|
29
|
+
version = "0.3.1"
|
|
30
|
+
|
|
31
|
+
[project.license]
|
|
32
|
+
file = "LICENSE.txt"
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Download = "https://pypi.org/project/cmp3/#files"
|
|
36
|
+
Index = "https://pypi.org/project/cmp3/"
|
|
37
|
+
Source = "https://github.com/johannes-programming/cmp3/"
|
|
38
|
+
Website = "https://cmp3.johannes-programming.online/"
|
cmp3-0.3.1/setup.cfg
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from functools import partial
|
|
3
|
+
from typing import *
|
|
4
|
+
|
|
5
|
+
import setdoc
|
|
6
|
+
|
|
7
|
+
__all__ = ["Comparable", "comparable", "update_rich_cmp"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def comparable(*, overwrites: Any = False) -> partial:
|
|
11
|
+
"This function returns a decorator."
|
|
12
|
+
return partial(update_rich_cmp, overwrites=overwrites)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def update_rich_cmp(cls: type, /, *, overwrites: Any = False) -> type:
|
|
16
|
+
@setdoc.basic
|
|
17
|
+
def __eq__(self: Self, other: Any) -> Any:
|
|
18
|
+
return self.__cmp__(other).__eq__(0)
|
|
19
|
+
|
|
20
|
+
@setdoc.basic
|
|
21
|
+
def __ge__(self: Self, other: Any) -> Any:
|
|
22
|
+
return self.__cmp__(other).__ge__(0)
|
|
23
|
+
|
|
24
|
+
@setdoc.basic
|
|
25
|
+
def __gt__(self: Self, other: Any) -> Any:
|
|
26
|
+
return self.__cmp__(other).__gt__(0)
|
|
27
|
+
|
|
28
|
+
@setdoc.basic
|
|
29
|
+
def __le__(self: Self, other: Any) -> Any:
|
|
30
|
+
return self.__cmp__(other).__le__(0)
|
|
31
|
+
|
|
32
|
+
@setdoc.basic
|
|
33
|
+
def __lt__(self: Self, other: Any) -> Any:
|
|
34
|
+
return self.__cmp__(other).__lt__(0)
|
|
35
|
+
|
|
36
|
+
@setdoc.basic
|
|
37
|
+
def __ne__(self: Self, other: Any) -> Any:
|
|
38
|
+
return self.__cmp__(other).__ne__(0)
|
|
39
|
+
|
|
40
|
+
func: Callable
|
|
41
|
+
funcs: list[Callable]
|
|
42
|
+
funcs = [
|
|
43
|
+
__eq__,
|
|
44
|
+
__ge__,
|
|
45
|
+
__gt__,
|
|
46
|
+
__le__,
|
|
47
|
+
__lt__,
|
|
48
|
+
__ne__,
|
|
49
|
+
]
|
|
50
|
+
for func in funcs:
|
|
51
|
+
if hasattr(cls, func.__name__) and not overwrites:
|
|
52
|
+
continue
|
|
53
|
+
setattr(cls, func.__name__, func)
|
|
54
|
+
try:
|
|
55
|
+
func.__module__ = cls.__module__
|
|
56
|
+
except AttributeError:
|
|
57
|
+
pass
|
|
58
|
+
try:
|
|
59
|
+
func.__qualname__ = cls.__qualname__
|
|
60
|
+
except AttributeError:
|
|
61
|
+
pass
|
|
62
|
+
return cls
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@comparable()
|
|
66
|
+
class Comparable(ABC):
|
|
67
|
+
__slots__ = ()
|
|
68
|
+
|
|
69
|
+
@abstractmethod
|
|
70
|
+
def __cmp__(self: Self, other: Any) -> Any: ...
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
|
|
3
|
+
__all__ = ["test"]
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test() -> unittest.TextTestRunner:
|
|
7
|
+
"This function runs all the tests."
|
|
8
|
+
loader: unittest.TestLoader
|
|
9
|
+
suite: unittest.TestSuite
|
|
10
|
+
runner: unittest.TextTestRunner
|
|
11
|
+
result: unittest.TextTestResult
|
|
12
|
+
loader = unittest.TestLoader()
|
|
13
|
+
suite = loader.discover(start_dir="cmp3.tests")
|
|
14
|
+
runner = unittest.TextTestRunner()
|
|
15
|
+
result = runner.run(suite)
|
|
16
|
+
return result
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cmp3
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: This project updates the concept of __cmp__ for python3.
|
|
5
|
+
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
|
+
License: The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Johannes
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
Project-URL: Download, https://pypi.org/project/cmp3/#files
|
|
28
|
+
Project-URL: Index, https://pypi.org/project/cmp3/
|
|
29
|
+
Project-URL: Source, https://github.com/johannes-programming/cmp3/
|
|
30
|
+
Project-URL: Website, https://cmp3.johannes-programming.online/
|
|
31
|
+
Classifier: Development Status :: 3 - Alpha
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Natural Language :: English
|
|
34
|
+
Classifier: Operating System :: OS Independent
|
|
35
|
+
Classifier: Programming Language :: Python
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
38
|
+
Classifier: Typing :: Typed
|
|
39
|
+
Requires-Python: >=3.11
|
|
40
|
+
Description-Content-Type: text/x-rst
|
|
41
|
+
License-File: LICENSE.txt
|
|
42
|
+
Requires-Dist: setdoc<2,>=1.2.6
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
====
|
|
46
|
+
cmp3
|
|
47
|
+
====
|
|
48
|
+
|
|
49
|
+
Visit the website `https://cmp3.johannes-programming.online/ <https://cmp3.johannes-programming.online/>`_ for more information.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
LICENSE.txt
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.rst
|
|
4
|
+
pyproject.toml
|
|
5
|
+
setup.cfg
|
|
6
|
+
src/cmp3/__init__.py
|
|
7
|
+
src/cmp3.egg-info/PKG-INFO
|
|
8
|
+
src/cmp3.egg-info/SOURCES.txt
|
|
9
|
+
src/cmp3.egg-info/dependency_links.txt
|
|
10
|
+
src/cmp3.egg-info/requires.txt
|
|
11
|
+
src/cmp3.egg-info/top_level.txt
|
|
12
|
+
src/cmp3/core/__init__.py
|
|
13
|
+
src/cmp3/tests/__init__.py
|
|
14
|
+
src/cmp3/tests/test_1984.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
setdoc<2,>=1.2.6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cmp3
|