cmp3 0.3.1__tar.gz → 0.4.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmp3
3
- Version: 0.3.1
3
+ Version: 0.4.0
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)
@@ -26,7 +26,7 @@ keywords = []
26
26
  name = "cmp3"
27
27
  readme = "README.rst"
28
28
  requires-python = ">=3.11"
29
- version = "0.3.1"
29
+ version = "0.4.0"
30
30
 
31
31
  [project.license]
32
32
  file = "LICENSE.txt"
@@ -4,15 +4,12 @@ from typing import *
4
4
 
5
5
  import setdoc
6
6
 
7
- __all__ = ["Comparable", "comparable", "update_rich_cmp"]
7
+ __all__ = ["Comparable", "comparable"]
8
8
 
9
9
 
10
- def comparable(*, overwrites: Any = False) -> partial:
11
- "This function returns a decorator."
12
- return partial(update_rich_cmp, overwrites=overwrites)
10
+ def comparable(cls: type, /) -> type:
11
+ "This decorator enforces the use of __cmp__ upon a class."
13
12
 
14
-
15
- def update_rich_cmp(cls: type, /, *, overwrites: Any = False) -> type:
16
13
  @setdoc.basic
17
14
  def __eq__(self: Self, other: Any) -> Any:
18
15
  return self.__cmp__(other).__eq__(0)
@@ -48,8 +45,6 @@ def update_rich_cmp(cls: type, /, *, overwrites: Any = False) -> type:
48
45
  __ne__,
49
46
  ]
50
47
  for func in funcs:
51
- if hasattr(cls, func.__name__) and not overwrites:
52
- continue
53
48
  setattr(cls, func.__name__, func)
54
49
  try:
55
50
  func.__module__ = cls.__module__
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmp3
3
- Version: 0.3.1
3
+ Version: 0.4.0
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)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes