cmp3 0.4.0__py3-none-any.whl → 0.5.1__py3-none-any.whl

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/core/__init__.py CHANGED
@@ -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__ = ["Comparable", "comparable"]
6
+ __all__ = ["CmpABC", "cmpDeco"]
8
7
 
9
8
 
10
- def comparable(cls: type, /) -> type:
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: list[Callable]
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
- @comparable()
61
- class Comparable(ABC):
59
+ @cmpDeco
60
+ class CmpABC(ABC):
62
61
  __slots__ = ()
63
62
 
64
63
  @abstractmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmp3
3
- Version: 0.4.0
3
+ Version: 0.5.1
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)
@@ -0,0 +1,9 @@
1
+ cmp3/__init__.py,sha256=hxvwX8wZhft-DkMAoU3xz65RMZib8nPQQiAbxba27iQ,49
2
+ cmp3/core/__init__.py,sha256=kkgjHGopJt6yX77ArxFa9qdg5ChcREc2fOakmZ9wAic,1457
3
+ cmp3/tests/__init__.py,sha256=HqmxhnTFFqh9Nzl7STV5GeDYqDmhrc9e1TCHssUbC1s,426
4
+ cmp3/tests/test_1984.py,sha256=_ami0cAP8vU0C8RpQhP1tLWnLFGTaeHlOG5O60RVKv8,222
5
+ cmp3-0.5.1.dist-info/licenses/LICENSE.txt,sha256=Jb9jm2E2hEO2LqnWwHeHt4cneyCbnZ1SBte0bgb9qoY,1074
6
+ cmp3-0.5.1.dist-info/METADATA,sha256=QrULyddpHLn4urfhSrtu6iswu0F6PcQ0XaFqitpbkn4,2300
7
+ cmp3-0.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ cmp3-0.5.1.dist-info/top_level.txt,sha256=FzJWsf0Xj_eeRJuFle30ZFjVZs8ahy7oLhYdWx8YkgA,5
9
+ cmp3-0.5.1.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- cmp3/__init__.py,sha256=hxvwX8wZhft-DkMAoU3xz65RMZib8nPQQiAbxba27iQ,49
2
- cmp3/core/__init__.py,sha256=VtXrfw-gmFFG3vAyJ-15tpOeP9Vdr5m6yvYfpaZjXmU,1500
3
- cmp3/tests/__init__.py,sha256=HqmxhnTFFqh9Nzl7STV5GeDYqDmhrc9e1TCHssUbC1s,426
4
- cmp3/tests/test_1984.py,sha256=_ami0cAP8vU0C8RpQhP1tLWnLFGTaeHlOG5O60RVKv8,222
5
- cmp3-0.4.0.dist-info/licenses/LICENSE.txt,sha256=Jb9jm2E2hEO2LqnWwHeHt4cneyCbnZ1SBte0bgb9qoY,1074
6
- cmp3-0.4.0.dist-info/METADATA,sha256=vKkJ3ApVFlN1IK-8vkyXcP0J8miX74V3cv9Hqx__XqU,2300
7
- cmp3-0.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- cmp3-0.4.0.dist-info/top_level.txt,sha256=FzJWsf0Xj_eeRJuFle30ZFjVZs8ahy7oLhYdWx8YkgA,5
9
- cmp3-0.4.0.dist-info/RECORD,,
File without changes