istr-python 1.1.35.post0__tar.gz → 1.1.36__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.
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/PKG-INFO +34 -34
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/README.md +33 -33
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/istr/istr.py +1 -1
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/istr_python.egg-info/PKG-INFO +34 -34
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/pyproject.toml +1 -1
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/istr/LICENSE.txt +0 -0
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/istr/__init__.py +0 -0
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/istr/istr - Copy.py +0 -0
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/istr_python.egg-info/SOURCES.txt +0 -0
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/istr_python.egg-info/dependency_links.txt +0 -0
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/istr_python.egg-info/top_level.txt +0 -0
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/setup.cfg +0 -0
- {istr_python-1.1.35.post0 → istr_python-1.1.36}/tests/test_istr.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: istr-python
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.36
|
|
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
|
|
@@ -379,7 +379,7 @@ In contrast to the builtin `range`, `istr.range` supports a non keyword paramete
|
|
|
379
379
|
`list(istr.range(length=3))` is equivalent to `istr.range(100, 1000)`
|
|
380
380
|
|
|
381
381
|
#### square root, cubic root and nth root
|
|
382
|
-
|
|
382
|
+
The methods `sqrt`, `cbrt`, `nth_root`provide the square root, cubic root and nth root of an istr. If there is no integer root, the fallback value (default `istr('0')` will be returned.
|
|
383
383
|
```
|
|
384
384
|
istr(64).sqrt() ==> istr('8')
|
|
385
385
|
istr(65).sqrt() ==> istr('0')
|
|
@@ -391,7 +391,7 @@ istr(1234**5+1).nth_root(5, 1) ==> istr('1')
|
|
|
391
391
|
istr(1234**5+1).nth_root(5, None) ==> None
|
|
392
392
|
|
|
393
393
|
istr.sqrt(64) ==> istr('8')
|
|
394
|
-
```
|
|
394
|
+
```
|
|
395
395
|
|
|
396
396
|
#### integer division
|
|
397
397
|
The method `divided_by` not only tests divisibility, but also returns the result of the division. If not possible, `istr('0')` will be returned, unless the *fallback* (last argument) is given, in which case *fallback* will be returned.
|
|
@@ -407,6 +407,7 @@ istr(19).divided_by(istr(3)) ==> istr('0')
|
|
|
407
407
|
istr.divided_by(18, 3) ==> 6
|
|
408
408
|
istr.divided_by(19, 3) ==> istr('0')
|
|
409
409
|
istr.divided_by(19, 3, 1) ==> istr('1')
|
|
410
|
+
```
|
|
410
411
|
|
|
411
412
|
#### test for even/odd
|
|
412
413
|
|
|
@@ -440,16 +441,16 @@ istr.is_palindrome(min) ==> False
|
|
|
440
441
|
#### test for increasing, decreasing, non-decreasing and non-increasing
|
|
441
442
|
|
|
442
443
|
It is possible to test whether the characters of an istr are increasing, decreasing, non-decreasing or non-increasing, like
|
|
443
|
-
|
|
444
|
+
```
|
|
444
445
|
istr(1223).is_increasing() ==> False
|
|
445
446
|
istr(1223).is_non_decreasing() ==> True
|
|
446
447
|
istr(3221).is_decreasing() ==> False
|
|
447
448
|
istr(3221).is_non_increasing ==> True
|
|
448
|
-
```
|
|
449
|
-
It is also possible to test for 'increasingness' and friends for anything that can be converted to a str:
|
|
450
449
|
```
|
|
450
|
+
It is also possible to test for 'increasingness' and friends for anything that can be converted to a str:
|
|
451
|
+
```
|
|
451
452
|
istr.is_increasing(123) ==> True
|
|
452
|
-
```
|
|
453
|
+
```
|
|
453
454
|
|
|
454
455
|
#### test for divisibility
|
|
455
456
|
|
|
@@ -466,7 +467,6 @@ It is also possible to test for divisibility of an ordinary int:
|
|
|
466
467
|
istr.is_divisible(18, 3) ==> True
|
|
467
468
|
istr.is_divisible(19, 3) ==> False
|
|
468
469
|
```
|
|
469
|
-
```
|
|
470
470
|
#### test for square
|
|
471
471
|
|
|
472
472
|
It is possible to test whether the value is a perfect square (provided the istr can be interpreted as an int) with the `is_square` method, e.g.
|
|
@@ -763,11 +763,11 @@ istr.count(10,3) ==> istr('10'), istr('13'), istr('16'), ...
|
|
|
763
763
|
#### istr.zip
|
|
764
764
|
|
|
765
765
|
The class method `istr.zip` is the equivalent of the zip builtin, but applies istr to each element. `istr.zip` also supports the join parameter:
|
|
766
|
-
|
|
766
|
+
```
|
|
767
767
|
print(list(istr.zip('12', '345')))
|
|
768
768
|
print(list(istr.zip('12', '345', join=True)))
|
|
769
769
|
print(list(istr.zip('12', '345', strict=True)))
|
|
770
|
-
|
|
770
|
+
```
|
|
771
771
|
results in
|
|
772
772
|
```
|
|
773
773
|
[(istr('1'), istr('3')), (istr('2'), istr('4'))]
|
|
@@ -781,11 +781,11 @@ to `istr` and then concatenate these.
|
|
|
781
781
|
|
|
782
782
|
`
|
|
783
783
|
|
|
784
|
-
```
|
|
784
|
+
```
|
|
785
785
|
list(istr.concat(((1,2),(3,4))) ==> istr([12,34])
|
|
786
786
|
list(istr.concat(istr.permutations(range(3),2))) ==>
|
|
787
787
|
[istr('01'), istr('02'), istr('10'), istr('12'), istr('20'), istr('21')]
|
|
788
|
-
```
|
|
788
|
+
```
|
|
789
789
|
|
|
790
790
|
#### prod to get product of an iterable
|
|
791
791
|
|
|
@@ -1115,29 +1115,29 @@ operator/function int str Example
|
|
|
1115
1115
|
+ x istr(20) + 3 ==> istr('23')
|
|
1116
1116
|
_ x istr(20) - 3 ==> istr('17')
|
|
1117
1117
|
* x istr(20) * 3 ==> istr('60')
|
|
1118
|
-
/ x istr(20) / 3 ==> istr('6')
|
|
1119
|
-
// x istr(20) // 3 ==> istr('6')
|
|
1120
|
-
% x istr(20) % 3 ==> istr('2')
|
|
1121
|
-
divmod x divmod(istr(20), 3) ==> (istr('6'), istr('2'))
|
|
1122
|
-
** x istr(2) ** 3 ==> istr('8')
|
|
1123
|
-
<=, <, >, >= x istr('100') > istr('2') ==> True
|
|
1124
|
-
abs x abs(istr(-20)) ==> istr('20')
|
|
1125
|
-
int x int(istr("20")) ==> 20
|
|
1126
|
-
float x float(istr("20")) ==> 20.0
|
|
1127
|
-
complex x complex(istr("20")) ==> (20+0j)
|
|
1128
|
-
== x x istr(20) == 20 ==> True | istr(20) == '20' ==> True
|
|
1129
|
-
bool x x *) bool(istr(' 0 ')) ==> False | bool(istr('')) ==> False
|
|
1130
|
-
@ x istr(20) @ 3 ==> istr('202020')
|
|
1131
|
-
| x istr(20) | '5' ==> istr('205')
|
|
1132
|
-
slicing x istr(12345)[1:3] ==> istr('23')
|
|
1133
|
-
iterate x [x for x in istr(20)] ==> [istr('2'), istr('0')]
|
|
1134
|
-
len x len(istr(' 20 ')) ==> 4
|
|
1135
|
-
count x istr(100).count(0) ==> 2
|
|
1118
|
+
/ x istr(20) / 3 ==> istr('6')
|
|
1119
|
+
// x istr(20) // 3 ==> istr('6')
|
|
1120
|
+
% x istr(20) % 3 ==> istr('2')
|
|
1121
|
+
divmod x divmod(istr(20), 3) ==> (istr('6'), istr('2'))
|
|
1122
|
+
** x istr(2) ** 3 ==> istr('8')
|
|
1123
|
+
<=, <, >, >= x istr('100') > istr('2') ==> True
|
|
1124
|
+
abs x abs(istr(-20)) ==> istr('20')
|
|
1125
|
+
int x int(istr("20")) ==> 20
|
|
1126
|
+
float x float(istr("20")) ==> 20.0
|
|
1127
|
+
complex x complex(istr("20")) ==> (20+0j)
|
|
1128
|
+
== x x istr(20) == 20 ==> True | istr(20) == '20' ==> True
|
|
1129
|
+
bool x x *) bool(istr(' 0 ')) ==> False | bool(istr('')) ==> False
|
|
1130
|
+
@ x istr(20) @ 3 ==> istr('202020')
|
|
1131
|
+
| x istr(20) | '5' ==> istr('205')
|
|
1132
|
+
slicing x istr(12345)[1:3] ==> istr('23')
|
|
1133
|
+
iterate x [x for x in istr(20)] ==> [istr('2'), istr('0')]
|
|
1134
|
+
len x len(istr(' 20 ')) ==> 4
|
|
1135
|
+
count x istr(100).count(0) ==> 2
|
|
1136
1136
|
istr.count(100) ==> istr('100'), istr('101'). istr('102'), ...
|
|
1137
|
-
index x istr(' 100 ').index('0') ==> 2
|
|
1138
|
-
split x istr('1 2').split() ==> (istr('1'), istr('2'))
|
|
1139
|
-
string format x f"|{istr(1234):6}|" ==> '|1234 |'
|
|
1140
|
-
other string methods x istr('aAbBcC').lower() ==> istr('aabbcc')
|
|
1137
|
+
index x istr(' 100 ').index('0') ==> 2
|
|
1138
|
+
split x istr('1 2').split() ==> (istr('1'), istr('2'))
|
|
1139
|
+
string format x f"|{istr(1234):6}|" ==> '|1234 |'
|
|
1140
|
+
other string methods x istr('aAbBcC').lower() ==> istr('aabbcc')
|
|
1141
1141
|
istr('aAbBcC').islower() ==> False
|
|
1142
1142
|
istr(' abc ').strip() ==> istr('abc')
|
|
1143
1143
|
...
|
|
@@ -366,7 +366,7 @@ In contrast to the builtin `range`, `istr.range` supports a non keyword paramete
|
|
|
366
366
|
`list(istr.range(length=3))` is equivalent to `istr.range(100, 1000)`
|
|
367
367
|
|
|
368
368
|
#### square root, cubic root and nth root
|
|
369
|
-
|
|
369
|
+
The methods `sqrt`, `cbrt`, `nth_root`provide the square root, cubic root and nth root of an istr. If there is no integer root, the fallback value (default `istr('0')` will be returned.
|
|
370
370
|
```
|
|
371
371
|
istr(64).sqrt() ==> istr('8')
|
|
372
372
|
istr(65).sqrt() ==> istr('0')
|
|
@@ -378,7 +378,7 @@ istr(1234**5+1).nth_root(5, 1) ==> istr('1')
|
|
|
378
378
|
istr(1234**5+1).nth_root(5, None) ==> None
|
|
379
379
|
|
|
380
380
|
istr.sqrt(64) ==> istr('8')
|
|
381
|
-
```
|
|
381
|
+
```
|
|
382
382
|
|
|
383
383
|
#### integer division
|
|
384
384
|
The method `divided_by` not only tests divisibility, but also returns the result of the division. If not possible, `istr('0')` will be returned, unless the *fallback* (last argument) is given, in which case *fallback* will be returned.
|
|
@@ -394,6 +394,7 @@ istr(19).divided_by(istr(3)) ==> istr('0')
|
|
|
394
394
|
istr.divided_by(18, 3) ==> 6
|
|
395
395
|
istr.divided_by(19, 3) ==> istr('0')
|
|
396
396
|
istr.divided_by(19, 3, 1) ==> istr('1')
|
|
397
|
+
```
|
|
397
398
|
|
|
398
399
|
#### test for even/odd
|
|
399
400
|
|
|
@@ -427,16 +428,16 @@ istr.is_palindrome(min) ==> False
|
|
|
427
428
|
#### test for increasing, decreasing, non-decreasing and non-increasing
|
|
428
429
|
|
|
429
430
|
It is possible to test whether the characters of an istr are increasing, decreasing, non-decreasing or non-increasing, like
|
|
430
|
-
|
|
431
|
+
```
|
|
431
432
|
istr(1223).is_increasing() ==> False
|
|
432
433
|
istr(1223).is_non_decreasing() ==> True
|
|
433
434
|
istr(3221).is_decreasing() ==> False
|
|
434
435
|
istr(3221).is_non_increasing ==> True
|
|
435
|
-
```
|
|
436
|
-
It is also possible to test for 'increasingness' and friends for anything that can be converted to a str:
|
|
437
436
|
```
|
|
437
|
+
It is also possible to test for 'increasingness' and friends for anything that can be converted to a str:
|
|
438
|
+
```
|
|
438
439
|
istr.is_increasing(123) ==> True
|
|
439
|
-
```
|
|
440
|
+
```
|
|
440
441
|
|
|
441
442
|
#### test for divisibility
|
|
442
443
|
|
|
@@ -453,7 +454,6 @@ It is also possible to test for divisibility of an ordinary int:
|
|
|
453
454
|
istr.is_divisible(18, 3) ==> True
|
|
454
455
|
istr.is_divisible(19, 3) ==> False
|
|
455
456
|
```
|
|
456
|
-
```
|
|
457
457
|
#### test for square
|
|
458
458
|
|
|
459
459
|
It is possible to test whether the value is a perfect square (provided the istr can be interpreted as an int) with the `is_square` method, e.g.
|
|
@@ -750,11 +750,11 @@ istr.count(10,3) ==> istr('10'), istr('13'), istr('16'), ...
|
|
|
750
750
|
#### istr.zip
|
|
751
751
|
|
|
752
752
|
The class method `istr.zip` is the equivalent of the zip builtin, but applies istr to each element. `istr.zip` also supports the join parameter:
|
|
753
|
-
|
|
753
|
+
```
|
|
754
754
|
print(list(istr.zip('12', '345')))
|
|
755
755
|
print(list(istr.zip('12', '345', join=True)))
|
|
756
756
|
print(list(istr.zip('12', '345', strict=True)))
|
|
757
|
-
|
|
757
|
+
```
|
|
758
758
|
results in
|
|
759
759
|
```
|
|
760
760
|
[(istr('1'), istr('3')), (istr('2'), istr('4'))]
|
|
@@ -768,11 +768,11 @@ to `istr` and then concatenate these.
|
|
|
768
768
|
|
|
769
769
|
`
|
|
770
770
|
|
|
771
|
-
```
|
|
771
|
+
```
|
|
772
772
|
list(istr.concat(((1,2),(3,4))) ==> istr([12,34])
|
|
773
773
|
list(istr.concat(istr.permutations(range(3),2))) ==>
|
|
774
774
|
[istr('01'), istr('02'), istr('10'), istr('12'), istr('20'), istr('21')]
|
|
775
|
-
```
|
|
775
|
+
```
|
|
776
776
|
|
|
777
777
|
#### prod to get product of an iterable
|
|
778
778
|
|
|
@@ -1102,29 +1102,29 @@ operator/function int str Example
|
|
|
1102
1102
|
+ x istr(20) + 3 ==> istr('23')
|
|
1103
1103
|
_ x istr(20) - 3 ==> istr('17')
|
|
1104
1104
|
* x istr(20) * 3 ==> istr('60')
|
|
1105
|
-
/ x istr(20) / 3 ==> istr('6')
|
|
1106
|
-
// x istr(20) // 3 ==> istr('6')
|
|
1107
|
-
% x istr(20) % 3 ==> istr('2')
|
|
1108
|
-
divmod x divmod(istr(20), 3) ==> (istr('6'), istr('2'))
|
|
1109
|
-
** x istr(2) ** 3 ==> istr('8')
|
|
1110
|
-
<=, <, >, >= x istr('100') > istr('2') ==> True
|
|
1111
|
-
abs x abs(istr(-20)) ==> istr('20')
|
|
1112
|
-
int x int(istr("20")) ==> 20
|
|
1113
|
-
float x float(istr("20")) ==> 20.0
|
|
1114
|
-
complex x complex(istr("20")) ==> (20+0j)
|
|
1115
|
-
== x x istr(20) == 20 ==> True | istr(20) == '20' ==> True
|
|
1116
|
-
bool x x *) bool(istr(' 0 ')) ==> False | bool(istr('')) ==> False
|
|
1117
|
-
@ x istr(20) @ 3 ==> istr('202020')
|
|
1118
|
-
| x istr(20) | '5' ==> istr('205')
|
|
1119
|
-
slicing x istr(12345)[1:3] ==> istr('23')
|
|
1120
|
-
iterate x [x for x in istr(20)] ==> [istr('2'), istr('0')]
|
|
1121
|
-
len x len(istr(' 20 ')) ==> 4
|
|
1122
|
-
count x istr(100).count(0) ==> 2
|
|
1105
|
+
/ x istr(20) / 3 ==> istr('6')
|
|
1106
|
+
// x istr(20) // 3 ==> istr('6')
|
|
1107
|
+
% x istr(20) % 3 ==> istr('2')
|
|
1108
|
+
divmod x divmod(istr(20), 3) ==> (istr('6'), istr('2'))
|
|
1109
|
+
** x istr(2) ** 3 ==> istr('8')
|
|
1110
|
+
<=, <, >, >= x istr('100') > istr('2') ==> True
|
|
1111
|
+
abs x abs(istr(-20)) ==> istr('20')
|
|
1112
|
+
int x int(istr("20")) ==> 20
|
|
1113
|
+
float x float(istr("20")) ==> 20.0
|
|
1114
|
+
complex x complex(istr("20")) ==> (20+0j)
|
|
1115
|
+
== x x istr(20) == 20 ==> True | istr(20) == '20' ==> True
|
|
1116
|
+
bool x x *) bool(istr(' 0 ')) ==> False | bool(istr('')) ==> False
|
|
1117
|
+
@ x istr(20) @ 3 ==> istr('202020')
|
|
1118
|
+
| x istr(20) | '5' ==> istr('205')
|
|
1119
|
+
slicing x istr(12345)[1:3] ==> istr('23')
|
|
1120
|
+
iterate x [x for x in istr(20)] ==> [istr('2'), istr('0')]
|
|
1121
|
+
len x len(istr(' 20 ')) ==> 4
|
|
1122
|
+
count x istr(100).count(0) ==> 2
|
|
1123
1123
|
istr.count(100) ==> istr('100'), istr('101'). istr('102'), ...
|
|
1124
|
-
index x istr(' 100 ').index('0') ==> 2
|
|
1125
|
-
split x istr('1 2').split() ==> (istr('1'), istr('2'))
|
|
1126
|
-
string format x f"|{istr(1234):6}|" ==> '|1234 |'
|
|
1127
|
-
other string methods x istr('aAbBcC').lower() ==> istr('aabbcc')
|
|
1124
|
+
index x istr(' 100 ').index('0') ==> 2
|
|
1125
|
+
split x istr('1 2').split() ==> (istr('1'), istr('2'))
|
|
1126
|
+
string format x f"|{istr(1234):6}|" ==> '|1234 |'
|
|
1127
|
+
other string methods x istr('aAbBcC').lower() ==> istr('aabbcc')
|
|
1128
1128
|
istr('aAbBcC').islower() ==> False
|
|
1129
1129
|
istr(' abc ').strip() ==> istr('abc')
|
|
1130
1130
|
...
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: istr-python
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.36
|
|
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
|
|
@@ -379,7 +379,7 @@ In contrast to the builtin `range`, `istr.range` supports a non keyword paramete
|
|
|
379
379
|
`list(istr.range(length=3))` is equivalent to `istr.range(100, 1000)`
|
|
380
380
|
|
|
381
381
|
#### square root, cubic root and nth root
|
|
382
|
-
|
|
382
|
+
The methods `sqrt`, `cbrt`, `nth_root`provide the square root, cubic root and nth root of an istr. If there is no integer root, the fallback value (default `istr('0')` will be returned.
|
|
383
383
|
```
|
|
384
384
|
istr(64).sqrt() ==> istr('8')
|
|
385
385
|
istr(65).sqrt() ==> istr('0')
|
|
@@ -391,7 +391,7 @@ istr(1234**5+1).nth_root(5, 1) ==> istr('1')
|
|
|
391
391
|
istr(1234**5+1).nth_root(5, None) ==> None
|
|
392
392
|
|
|
393
393
|
istr.sqrt(64) ==> istr('8')
|
|
394
|
-
```
|
|
394
|
+
```
|
|
395
395
|
|
|
396
396
|
#### integer division
|
|
397
397
|
The method `divided_by` not only tests divisibility, but also returns the result of the division. If not possible, `istr('0')` will be returned, unless the *fallback* (last argument) is given, in which case *fallback* will be returned.
|
|
@@ -407,6 +407,7 @@ istr(19).divided_by(istr(3)) ==> istr('0')
|
|
|
407
407
|
istr.divided_by(18, 3) ==> 6
|
|
408
408
|
istr.divided_by(19, 3) ==> istr('0')
|
|
409
409
|
istr.divided_by(19, 3, 1) ==> istr('1')
|
|
410
|
+
```
|
|
410
411
|
|
|
411
412
|
#### test for even/odd
|
|
412
413
|
|
|
@@ -440,16 +441,16 @@ istr.is_palindrome(min) ==> False
|
|
|
440
441
|
#### test for increasing, decreasing, non-decreasing and non-increasing
|
|
441
442
|
|
|
442
443
|
It is possible to test whether the characters of an istr are increasing, decreasing, non-decreasing or non-increasing, like
|
|
443
|
-
|
|
444
|
+
```
|
|
444
445
|
istr(1223).is_increasing() ==> False
|
|
445
446
|
istr(1223).is_non_decreasing() ==> True
|
|
446
447
|
istr(3221).is_decreasing() ==> False
|
|
447
448
|
istr(3221).is_non_increasing ==> True
|
|
448
|
-
```
|
|
449
|
-
It is also possible to test for 'increasingness' and friends for anything that can be converted to a str:
|
|
450
449
|
```
|
|
450
|
+
It is also possible to test for 'increasingness' and friends for anything that can be converted to a str:
|
|
451
|
+
```
|
|
451
452
|
istr.is_increasing(123) ==> True
|
|
452
|
-
```
|
|
453
|
+
```
|
|
453
454
|
|
|
454
455
|
#### test for divisibility
|
|
455
456
|
|
|
@@ -466,7 +467,6 @@ It is also possible to test for divisibility of an ordinary int:
|
|
|
466
467
|
istr.is_divisible(18, 3) ==> True
|
|
467
468
|
istr.is_divisible(19, 3) ==> False
|
|
468
469
|
```
|
|
469
|
-
```
|
|
470
470
|
#### test for square
|
|
471
471
|
|
|
472
472
|
It is possible to test whether the value is a perfect square (provided the istr can be interpreted as an int) with the `is_square` method, e.g.
|
|
@@ -763,11 +763,11 @@ istr.count(10,3) ==> istr('10'), istr('13'), istr('16'), ...
|
|
|
763
763
|
#### istr.zip
|
|
764
764
|
|
|
765
765
|
The class method `istr.zip` is the equivalent of the zip builtin, but applies istr to each element. `istr.zip` also supports the join parameter:
|
|
766
|
-
|
|
766
|
+
```
|
|
767
767
|
print(list(istr.zip('12', '345')))
|
|
768
768
|
print(list(istr.zip('12', '345', join=True)))
|
|
769
769
|
print(list(istr.zip('12', '345', strict=True)))
|
|
770
|
-
|
|
770
|
+
```
|
|
771
771
|
results in
|
|
772
772
|
```
|
|
773
773
|
[(istr('1'), istr('3')), (istr('2'), istr('4'))]
|
|
@@ -781,11 +781,11 @@ to `istr` and then concatenate these.
|
|
|
781
781
|
|
|
782
782
|
`
|
|
783
783
|
|
|
784
|
-
```
|
|
784
|
+
```
|
|
785
785
|
list(istr.concat(((1,2),(3,4))) ==> istr([12,34])
|
|
786
786
|
list(istr.concat(istr.permutations(range(3),2))) ==>
|
|
787
787
|
[istr('01'), istr('02'), istr('10'), istr('12'), istr('20'), istr('21')]
|
|
788
|
-
```
|
|
788
|
+
```
|
|
789
789
|
|
|
790
790
|
#### prod to get product of an iterable
|
|
791
791
|
|
|
@@ -1115,29 +1115,29 @@ operator/function int str Example
|
|
|
1115
1115
|
+ x istr(20) + 3 ==> istr('23')
|
|
1116
1116
|
_ x istr(20) - 3 ==> istr('17')
|
|
1117
1117
|
* x istr(20) * 3 ==> istr('60')
|
|
1118
|
-
/ x istr(20) / 3 ==> istr('6')
|
|
1119
|
-
// x istr(20) // 3 ==> istr('6')
|
|
1120
|
-
% x istr(20) % 3 ==> istr('2')
|
|
1121
|
-
divmod x divmod(istr(20), 3) ==> (istr('6'), istr('2'))
|
|
1122
|
-
** x istr(2) ** 3 ==> istr('8')
|
|
1123
|
-
<=, <, >, >= x istr('100') > istr('2') ==> True
|
|
1124
|
-
abs x abs(istr(-20)) ==> istr('20')
|
|
1125
|
-
int x int(istr("20")) ==> 20
|
|
1126
|
-
float x float(istr("20")) ==> 20.0
|
|
1127
|
-
complex x complex(istr("20")) ==> (20+0j)
|
|
1128
|
-
== x x istr(20) == 20 ==> True | istr(20) == '20' ==> True
|
|
1129
|
-
bool x x *) bool(istr(' 0 ')) ==> False | bool(istr('')) ==> False
|
|
1130
|
-
@ x istr(20) @ 3 ==> istr('202020')
|
|
1131
|
-
| x istr(20) | '5' ==> istr('205')
|
|
1132
|
-
slicing x istr(12345)[1:3] ==> istr('23')
|
|
1133
|
-
iterate x [x for x in istr(20)] ==> [istr('2'), istr('0')]
|
|
1134
|
-
len x len(istr(' 20 ')) ==> 4
|
|
1135
|
-
count x istr(100).count(0) ==> 2
|
|
1118
|
+
/ x istr(20) / 3 ==> istr('6')
|
|
1119
|
+
// x istr(20) // 3 ==> istr('6')
|
|
1120
|
+
% x istr(20) % 3 ==> istr('2')
|
|
1121
|
+
divmod x divmod(istr(20), 3) ==> (istr('6'), istr('2'))
|
|
1122
|
+
** x istr(2) ** 3 ==> istr('8')
|
|
1123
|
+
<=, <, >, >= x istr('100') > istr('2') ==> True
|
|
1124
|
+
abs x abs(istr(-20)) ==> istr('20')
|
|
1125
|
+
int x int(istr("20")) ==> 20
|
|
1126
|
+
float x float(istr("20")) ==> 20.0
|
|
1127
|
+
complex x complex(istr("20")) ==> (20+0j)
|
|
1128
|
+
== x x istr(20) == 20 ==> True | istr(20) == '20' ==> True
|
|
1129
|
+
bool x x *) bool(istr(' 0 ')) ==> False | bool(istr('')) ==> False
|
|
1130
|
+
@ x istr(20) @ 3 ==> istr('202020')
|
|
1131
|
+
| x istr(20) | '5' ==> istr('205')
|
|
1132
|
+
slicing x istr(12345)[1:3] ==> istr('23')
|
|
1133
|
+
iterate x [x for x in istr(20)] ==> [istr('2'), istr('0')]
|
|
1134
|
+
len x len(istr(' 20 ')) ==> 4
|
|
1135
|
+
count x istr(100).count(0) ==> 2
|
|
1136
1136
|
istr.count(100) ==> istr('100'), istr('101'). istr('102'), ...
|
|
1137
|
-
index x istr(' 100 ').index('0') ==> 2
|
|
1138
|
-
split x istr('1 2').split() ==> (istr('1'), istr('2'))
|
|
1139
|
-
string format x f"|{istr(1234):6}|" ==> '|1234 |'
|
|
1140
|
-
other string methods x istr('aAbBcC').lower() ==> istr('aabbcc')
|
|
1137
|
+
index x istr(' 100 ').index('0') ==> 2
|
|
1138
|
+
split x istr('1 2').split() ==> (istr('1'), istr('2'))
|
|
1139
|
+
string format x f"|{istr(1234):6}|" ==> '|1234 |'
|
|
1140
|
+
other string methods x istr('aAbBcC').lower() ==> istr('aabbcc')
|
|
1141
1141
|
istr('aAbBcC').islower() ==> False
|
|
1142
1142
|
istr(' abc ').strip() ==> istr('abc')
|
|
1143
1143
|
...
|
|
@@ -10,7 +10,7 @@ authors = [
|
|
|
10
10
|
{ name = "Ruud van der Ham", email = "rt.van.der.ham@gmail.com" },
|
|
11
11
|
]
|
|
12
12
|
description = "istr - strings you can count on"
|
|
13
|
-
version = "1.1.
|
|
13
|
+
version = "1.1.36"
|
|
14
14
|
readme = "README.md"
|
|
15
15
|
requires-python = ">=3.10"
|
|
16
16
|
dependencies = []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|