istr-python 1.0.6__tar.gz → 1.0.7__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.1
2
2
  Name: istr-python
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: istr - strings you can count on
5
5
  Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/salabim/istr
@@ -5,7 +5,7 @@
5
5
  # |_||___/ \__||_|
6
6
  # strings you can count on
7
7
 
8
- __version__ = "1.0.6"
8
+ __version__ = "1.0.7"
9
9
  import functools
10
10
  import math
11
11
  import copy
@@ -315,7 +315,10 @@ class istr(str):
315
315
  raise TypeError(f"unsupported operand for {op}: {self._frepr(other)} and {self._frepr(self)}")
316
316
  else:
317
317
  raise TypeError(f"unsupported operand for {op}: {self._frepr(self)} and {self._frepr(other)}")
318
- return istr(getattr(self._as_int, name)(self._to_int(other)))
318
+ if "<" in op or ">" in op:
319
+ return getattr(self._as_int, name)(self._to_int(other))
320
+ else:
321
+ return istr(getattr(self._as_int, name)(self._to_int(other)))
319
322
  else:
320
323
  if not self.is_int():
321
324
  raise TypeError(f"unsupported operand for {op}: {self._frepr(self)}")
@@ -551,7 +554,9 @@ class istr(str):
551
554
 
552
555
 
553
556
  def main():
554
- ...
557
+ print(repr(istr(8) < 9))
558
+
555
559
 
556
560
  if __name__ == "__main__":
557
561
  main()
562
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: istr-python
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: istr - strings you can count on
5
5
  Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/salabim/istr
@@ -8,7 +8,7 @@ authors = [
8
8
  {name = "Ruud van der Ham", email = "rt.van.der.ham@gmail.com"}
9
9
  ]
10
10
  description = "istr - strings you can count on"
11
- version = "1.0.6"
11
+ version = "1.0.7"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.7"
14
14
  dependencies = [
@@ -68,6 +68,7 @@ def test_arithmetic():
68
68
 
69
69
 
70
70
  def test_lt():
71
+ assert type(two < three) == bool
71
72
  assert two < three
72
73
  assert 2 < three
73
74
  assert two < 3
@@ -82,6 +83,7 @@ def test_lt():
82
83
 
83
84
 
84
85
  def test_le():
86
+ assert type(two <= three) == bool
85
87
  assert two <= three
86
88
  assert 2 <= three
87
89
  assert two <= 3
@@ -92,6 +94,7 @@ def test_le():
92
94
 
93
95
 
94
96
  def test_gt():
97
+ assert type(three > two) == bool
95
98
  assert three > two
96
99
  assert 3 > two
97
100
  assert three > 2
@@ -106,6 +109,7 @@ def test_gt():
106
109
 
107
110
 
108
111
  def test_ge():
112
+ assert type(three >= two) == bool
109
113
  assert three >= two
110
114
  assert 3 >= two
111
115
  assert three >= 2
@@ -628,3 +632,4 @@ def test_subclassing():
628
632
 
629
633
  if __name__ == "__main__":
630
634
  pytest.main(["-vv", "-s", "-x", __file__])
635
+
File without changes
File without changes