cmp3 0.6.5__tar.gz → 0.6.6__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.6.5
3
+ Version: 0.6.6
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.6.5"
29
+ version = "0.6.6"
30
30
 
31
31
  [project.license]
32
32
  file = "LICENSE.txt"
@@ -8,6 +8,8 @@ __all__ = ["CmpABC", "cmp", "cmpDeco"]
8
8
 
9
9
  def cmp(x: Any, y: Any, /, *, mode: str = "portingguide") -> float | int:
10
10
  "This function returns a value that compares to 0 as x compares to y."
11
+ if mode == "dunder":
12
+ return x.__cmp__(y)
11
13
  if mode == "portingguide":
12
14
  return (x > y) - (x < y)
13
15
  if mode == "poset":
@@ -16,7 +18,7 @@ def cmp(x: Any, y: Any, /, *, mode: str = "portingguide") -> float | int:
16
18
 
17
19
 
18
20
  def cmp_poset(x: Any, y: Any, /) -> float | int:
19
- "This function returns a value that compares to 0 as x compares to y under the assumption that both arguments belong to a poset."
21
+ "This function returns a value that compares to 0 as x compares to y assuming a partial order."
20
22
  if x <= y:
21
23
  if y <= x:
22
24
  return 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmp3
3
- Version: 0.6.5
3
+ Version: 0.6.6
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