istr-python 1.1.1__tar.gz → 1.1.2__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.1 → istr_python-1.1.2}/PKG-INFO +11 -5
- {istr_python-1.1.1 → istr_python-1.1.2}/README.md +10 -4
- {istr_python-1.1.1 → istr_python-1.1.2}/istr/istr.py +13 -1
- {istr_python-1.1.1 → istr_python-1.1.2}/istr_python.egg-info/PKG-INFO +11 -5
- {istr_python-1.1.1 → istr_python-1.1.2}/pyproject.toml +1 -1
- {istr_python-1.1.1 → istr_python-1.1.2}/istr/LICENSE.txt +0 -0
- {istr_python-1.1.1 → istr_python-1.1.2}/istr/__init__.py +0 -0
- {istr_python-1.1.1 → istr_python-1.1.2}/istr_python.egg-info/SOURCES.txt +0 -0
- {istr_python-1.1.1 → istr_python-1.1.2}/istr_python.egg-info/dependency_links.txt +0 -0
- {istr_python-1.1.1 → istr_python-1.1.2}/istr_python.egg-info/top_level.txt +0 -0
- {istr_python-1.1.1 → istr_python-1.1.2}/setup.cfg +0 -0
- {istr_python-1.1.1 → istr_python-1.1.2}/tests/test_istr.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: istr-python
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
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
|
|
@@ -29,7 +29,7 @@ M O N E Y
|
|
|
29
29
|
can be nicely, albeit not very efficient, coded as:
|
|
30
30
|
```
|
|
31
31
|
import itertools
|
|
32
|
-
|
|
32
|
+
import istr
|
|
33
33
|
|
|
34
34
|
for s, e, n, d, m, o, r, y in istr(itertools.permutations(range(10), 8)):
|
|
35
35
|
if m and ((s|e|n|d) + (m|o|r|e) == (m|o|n|e|y)):
|
|
@@ -50,11 +50,11 @@ And the module is a demonstration of extending a class (str) with extra and chan
|
|
|
50
50
|
### Installation
|
|
51
51
|
Installing istr with pip is easy.
|
|
52
52
|
```
|
|
53
|
-
|
|
53
|
+
pip install istr-python
|
|
54
54
|
```
|
|
55
55
|
or when you want to upgrade,
|
|
56
56
|
```
|
|
57
|
-
|
|
57
|
+
pip install istr-python --upgrade
|
|
58
58
|
```
|
|
59
59
|
Alternatively, istr.py can be just copied into you current work directory from GitHub (https://github.com/salabim/istr).
|
|
60
60
|
|
|
@@ -65,6 +65,12 @@ No dependencies!
|
|
|
65
65
|
|
|
66
66
|
Just start with
|
|
67
67
|
|
|
68
|
+
```
|
|
69
|
+
import istr
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
or the more conventional, more verbose:
|
|
73
|
+
|
|
68
74
|
```
|
|
69
75
|
from istr import istr
|
|
70
76
|
```
|
|
@@ -558,7 +564,7 @@ When a class is derived from istr, all methods will return that newly derived cl
|
|
|
558
564
|
|
|
559
565
|
E.g.
|
|
560
566
|
```
|
|
561
|
-
class jstr(istr):
|
|
567
|
+
class jstr(istr.type):
|
|
562
568
|
...
|
|
563
569
|
|
|
564
570
|
print(repr(jstr(4) * jstr(5)))
|
|
@@ -16,7 +16,7 @@ M O N E Y
|
|
|
16
16
|
can be nicely, albeit not very efficient, coded as:
|
|
17
17
|
```
|
|
18
18
|
import itertools
|
|
19
|
-
|
|
19
|
+
import istr
|
|
20
20
|
|
|
21
21
|
for s, e, n, d, m, o, r, y in istr(itertools.permutations(range(10), 8)):
|
|
22
22
|
if m and ((s|e|n|d) + (m|o|r|e) == (m|o|n|e|y)):
|
|
@@ -37,11 +37,11 @@ And the module is a demonstration of extending a class (str) with extra and chan
|
|
|
37
37
|
### Installation
|
|
38
38
|
Installing istr with pip is easy.
|
|
39
39
|
```
|
|
40
|
-
|
|
40
|
+
pip install istr-python
|
|
41
41
|
```
|
|
42
42
|
or when you want to upgrade,
|
|
43
43
|
```
|
|
44
|
-
|
|
44
|
+
pip install istr-python --upgrade
|
|
45
45
|
```
|
|
46
46
|
Alternatively, istr.py can be just copied into you current work directory from GitHub (https://github.com/salabim/istr).
|
|
47
47
|
|
|
@@ -52,6 +52,12 @@ No dependencies!
|
|
|
52
52
|
|
|
53
53
|
Just start with
|
|
54
54
|
|
|
55
|
+
```
|
|
56
|
+
import istr
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
or the more conventional, more verbose:
|
|
60
|
+
|
|
55
61
|
```
|
|
56
62
|
from istr import istr
|
|
57
63
|
```
|
|
@@ -545,7 +551,7 @@ When a class is derived from istr, all methods will return that newly derived cl
|
|
|
545
551
|
|
|
546
552
|
E.g.
|
|
547
553
|
```
|
|
548
|
-
class jstr(istr):
|
|
554
|
+
class jstr(istr.type):
|
|
549
555
|
...
|
|
550
556
|
|
|
551
557
|
print(repr(jstr(4) * jstr(5)))
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# |_||___/ \__||_|
|
|
6
6
|
# strings you can count on
|
|
7
7
|
|
|
8
|
-
__version__ = "1.1.
|
|
8
|
+
__version__ = "1.1.2"
|
|
9
9
|
import functools
|
|
10
10
|
import math
|
|
11
11
|
import itertools
|
|
@@ -602,10 +602,22 @@ class istr(str):
|
|
|
602
602
|
cls._digits_cache[key] = result
|
|
603
603
|
return result
|
|
604
604
|
|
|
605
|
+
istr.type=type(istr(0))
|
|
606
|
+
|
|
605
607
|
|
|
606
608
|
def main():
|
|
607
609
|
...
|
|
608
610
|
|
|
611
|
+
class istrModule(types.ModuleType):
|
|
612
|
+
def __call__(self, *args, **kwargs):
|
|
613
|
+
return istr.__call__(*args, **kwargs)
|
|
614
|
+
def __setattr__(self, item, value):
|
|
615
|
+
setattr(istr,item,value)
|
|
616
|
+
def __getattr__(self, item,):
|
|
617
|
+
return getattr(istr,item)
|
|
618
|
+
|
|
619
|
+
sys.modules["istr"].__class__ = istrModule
|
|
620
|
+
|
|
609
621
|
if __name__ == "__main__":
|
|
610
622
|
main()
|
|
611
623
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: istr-python
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
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
|
|
@@ -29,7 +29,7 @@ M O N E Y
|
|
|
29
29
|
can be nicely, albeit not very efficient, coded as:
|
|
30
30
|
```
|
|
31
31
|
import itertools
|
|
32
|
-
|
|
32
|
+
import istr
|
|
33
33
|
|
|
34
34
|
for s, e, n, d, m, o, r, y in istr(itertools.permutations(range(10), 8)):
|
|
35
35
|
if m and ((s|e|n|d) + (m|o|r|e) == (m|o|n|e|y)):
|
|
@@ -50,11 +50,11 @@ And the module is a demonstration of extending a class (str) with extra and chan
|
|
|
50
50
|
### Installation
|
|
51
51
|
Installing istr with pip is easy.
|
|
52
52
|
```
|
|
53
|
-
|
|
53
|
+
pip install istr-python
|
|
54
54
|
```
|
|
55
55
|
or when you want to upgrade,
|
|
56
56
|
```
|
|
57
|
-
|
|
57
|
+
pip install istr-python --upgrade
|
|
58
58
|
```
|
|
59
59
|
Alternatively, istr.py can be just copied into you current work directory from GitHub (https://github.com/salabim/istr).
|
|
60
60
|
|
|
@@ -65,6 +65,12 @@ No dependencies!
|
|
|
65
65
|
|
|
66
66
|
Just start with
|
|
67
67
|
|
|
68
|
+
```
|
|
69
|
+
import istr
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
or the more conventional, more verbose:
|
|
73
|
+
|
|
68
74
|
```
|
|
69
75
|
from istr import istr
|
|
70
76
|
```
|
|
@@ -558,7 +564,7 @@ When a class is derived from istr, all methods will return that newly derived cl
|
|
|
558
564
|
|
|
559
565
|
E.g.
|
|
560
566
|
```
|
|
561
|
-
class jstr(istr):
|
|
567
|
+
class jstr(istr.type):
|
|
562
568
|
...
|
|
563
569
|
|
|
564
570
|
print(repr(jstr(4) * jstr(5)))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|