istr-python 0.0.0__tar.gz → 0.0.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-0.0.0 → istr_python-0.0.2}/PKG-INFO +21 -17
- {istr-python-0.0.0 → istr_python-0.0.2}/README.md +19 -15
- istr_python-0.0.2/istr/__init__.py +1 -0
- {istr-python-0.0.0 → istr_python-0.0.2}/istr/istr.py +1 -2
- istr_python-0.0.2/istr/sendmoremoney.py +11 -0
- {istr-python-0.0.0 → istr_python-0.0.2}/istr_python.egg-info/PKG-INFO +21 -17
- {istr-python-0.0.0 → istr_python-0.0.2}/istr_python.egg-info/SOURCES.txt +2 -1
- {istr-python-0.0.0 → istr_python-0.0.2}/pyproject.toml +3 -2
- istr-python-0.0.0/test/test_istrlib.py → istr_python-0.0.2/tests/test_istr.py +1 -1
- istr-python-0.0.0/istr/__init__.py +0 -0
- {istr-python-0.0.0 → istr_python-0.0.2}/istr/install istr.py +0 -0
- {istr-python-0.0.0 → istr_python-0.0.2}/istr_python.egg-info/dependency_links.txt +0 -0
- {istr-python-0.0.0 → istr_python-0.0.2}/istr_python.egg-info/top_level.txt +0 -0
- {istr-python-0.0.0 → istr_python-0.0.2}/setup.cfg +0 -0
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: istr-python
|
|
3
|
-
Version: 0.0.
|
|
4
|
-
Summary: istr
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: istr is a module to use strings as if they were integers.
|
|
5
5
|
Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
|
|
6
6
|
Requires-Python: >=3.7
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
|
|
9
9
|
# Introduction
|
|
10
10
|
|
|
11
|
-
The
|
|
11
|
+
The istr module has exactly one class: istr.
|
|
12
12
|
|
|
13
|
-
With this it is possible to interpret string as if they were integers.
|
|
14
|
-
|
|
13
|
+
With this it is possible to interpret string as if they were integers.
|
|
14
|
+
|
|
15
|
+
This can be very handy for solving puzzles, but also for other purposes.
|
|
16
|
+
|
|
17
|
+
And it is a nice demonstration of extending a class (str) with extra and changed functionality.
|
|
15
18
|
|
|
16
19
|
# Installation
|
|
17
|
-
Installing
|
|
20
|
+
Installing istr with pip is easy.
|
|
18
21
|
```
|
|
19
|
-
$ pip install
|
|
22
|
+
$ pip install istr-python
|
|
20
23
|
```
|
|
21
24
|
or when you want to upgrade,
|
|
22
25
|
```
|
|
23
|
-
$ pip install
|
|
26
|
+
$ pip install istr-python --upgrade
|
|
24
27
|
```
|
|
25
|
-
|
|
26
|
-
Alternatively, istrlib.py can be just copied into you current work directory from GitHub (https://github.com/salabim/istrlib).
|
|
28
|
+
Alternatively, istr.py can be just copied into you current work directory from GitHub (https://github.com/salabim/istr).
|
|
27
29
|
|
|
28
30
|
No dependencies!
|
|
29
31
|
|
|
@@ -31,7 +33,7 @@ No dependencies!
|
|
|
31
33
|
Just start with
|
|
32
34
|
|
|
33
35
|
```
|
|
34
|
-
from
|
|
36
|
+
from istr import istr
|
|
35
37
|
```
|
|
36
38
|
|
|
37
39
|
Now we can define some istrs:
|
|
@@ -43,19 +45,19 @@ Them we can do
|
|
|
43
45
|
```
|
|
44
46
|
x= four * five
|
|
45
47
|
```
|
|
46
|
-
, after which x is `istr("
|
|
48
|
+
, after which x is `istr("20")`
|
|
47
49
|
|
|
48
50
|
And now we can do
|
|
49
51
|
```
|
|
50
|
-
print(x ==
|
|
51
|
-
print(x == "
|
|
52
|
+
print(x == 20)
|
|
53
|
+
print(x == "20")
|
|
52
54
|
```
|
|
53
55
|
resulting in two times `True`. That's because istr instances are treated as int, although they are strings.
|
|
54
56
|
|
|
55
57
|
That means that we can also say
|
|
56
58
|
```
|
|
57
|
-
print(x <
|
|
58
|
-
print(x >= "
|
|
59
|
+
print(x < 30)
|
|
60
|
+
print(x >= "10")
|
|
59
61
|
```
|
|
60
62
|
again resulting in two times `True`.
|
|
61
63
|
|
|
@@ -103,7 +105,7 @@ Note that all calculations are strictly integer calculations. That means that if
|
|
|
103
105
|
Also divisions are always floor divisions!
|
|
104
106
|
|
|
105
107
|
There's a special case for `istr("")`. This is a proper empty string, but also represents the value of 0.
|
|
106
|
-
That is to allow for istr("").join(i for i in "01234"
|
|
108
|
+
That is to allow for istr("").join(i for i in "01234)"
|
|
107
109
|
|
|
108
110
|
Sorting a list of istrs is based on the integer value, not the string. So
|
|
109
111
|
|
|
@@ -121,3 +123,5 @@ is
|
|
|
121
123
|
|
|
122
124
|
`'0 1 2 3 4 5 6 7 8 9 10 11'`
|
|
123
125
|
|
|
126
|
+
# Additional methods
|
|
127
|
+
It is possible to test for even/odd
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
# Introduction
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The istr module has exactly one class: istr.
|
|
4
4
|
|
|
5
|
-
With this it is possible to interpret string as if they were integers.
|
|
6
|
-
|
|
5
|
+
With this it is possible to interpret string as if they were integers.
|
|
6
|
+
|
|
7
|
+
This can be very handy for solving puzzles, but also for other purposes.
|
|
8
|
+
|
|
9
|
+
And it is a nice demonstration of extending a class (str) with extra and changed functionality.
|
|
7
10
|
|
|
8
11
|
# Installation
|
|
9
|
-
Installing
|
|
12
|
+
Installing istr with pip is easy.
|
|
10
13
|
```
|
|
11
|
-
$ pip install
|
|
14
|
+
$ pip install istr-python
|
|
12
15
|
```
|
|
13
16
|
or when you want to upgrade,
|
|
14
17
|
```
|
|
15
|
-
$ pip install
|
|
18
|
+
$ pip install istr-python --upgrade
|
|
16
19
|
```
|
|
17
|
-
|
|
18
|
-
Alternatively, istrlib.py can be just copied into you current work directory from GitHub (https://github.com/salabim/istrlib).
|
|
20
|
+
Alternatively, istr.py can be just copied into you current work directory from GitHub (https://github.com/salabim/istr).
|
|
19
21
|
|
|
20
22
|
No dependencies!
|
|
21
23
|
|
|
@@ -23,7 +25,7 @@ No dependencies!
|
|
|
23
25
|
Just start with
|
|
24
26
|
|
|
25
27
|
```
|
|
26
|
-
from
|
|
28
|
+
from istr import istr
|
|
27
29
|
```
|
|
28
30
|
|
|
29
31
|
Now we can define some istrs:
|
|
@@ -35,19 +37,19 @@ Them we can do
|
|
|
35
37
|
```
|
|
36
38
|
x= four * five
|
|
37
39
|
```
|
|
38
|
-
, after which x is `istr("
|
|
40
|
+
, after which x is `istr("20")`
|
|
39
41
|
|
|
40
42
|
And now we can do
|
|
41
43
|
```
|
|
42
|
-
print(x ==
|
|
43
|
-
print(x == "
|
|
44
|
+
print(x == 20)
|
|
45
|
+
print(x == "20")
|
|
44
46
|
```
|
|
45
47
|
resulting in two times `True`. That's because istr instances are treated as int, although they are strings.
|
|
46
48
|
|
|
47
49
|
That means that we can also say
|
|
48
50
|
```
|
|
49
|
-
print(x <
|
|
50
|
-
print(x >= "
|
|
51
|
+
print(x < 30)
|
|
52
|
+
print(x >= "10")
|
|
51
53
|
```
|
|
52
54
|
again resulting in two times `True`.
|
|
53
55
|
|
|
@@ -95,7 +97,7 @@ Note that all calculations are strictly integer calculations. That means that if
|
|
|
95
97
|
Also divisions are always floor divisions!
|
|
96
98
|
|
|
97
99
|
There's a special case for `istr("")`. This is a proper empty string, but also represents the value of 0.
|
|
98
|
-
That is to allow for istr("").join(i for i in "01234"
|
|
100
|
+
That is to allow for istr("").join(i for i in "01234)"
|
|
99
101
|
|
|
100
102
|
Sorting a list of istrs is based on the integer value, not the string. So
|
|
101
103
|
|
|
@@ -113,3 +115,5 @@ is
|
|
|
113
115
|
|
|
114
116
|
`'0 1 2 3 4 5 6 7 8 9 10 11'`
|
|
115
117
|
|
|
118
|
+
# Additional methods
|
|
119
|
+
It is possible to test for even/odd
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .istr import *
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import itertools
|
|
2
|
+
from istr import istr
|
|
3
|
+
print(istr)
|
|
4
|
+
|
|
5
|
+
for s, e, n, d, m, o, r, y in istr(itertools.permutations("0123456789", 8)):
|
|
6
|
+
if (m > 0) and ((s | e | n | d) + (m | o | r | e) == (m | o | n | e | y)):
|
|
7
|
+
print(f" {s|e|n|d}")
|
|
8
|
+
print(f" {m|o|r|e}")
|
|
9
|
+
print("-----")
|
|
10
|
+
print(m | o | n | e | y)
|
|
11
|
+
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: istr-python
|
|
3
|
-
Version: 0.0.
|
|
4
|
-
Summary: istr
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: istr is a module to use strings as if they were integers.
|
|
5
5
|
Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
|
|
6
6
|
Requires-Python: >=3.7
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
|
|
9
9
|
# Introduction
|
|
10
10
|
|
|
11
|
-
The
|
|
11
|
+
The istr module has exactly one class: istr.
|
|
12
12
|
|
|
13
|
-
With this it is possible to interpret string as if they were integers.
|
|
14
|
-
|
|
13
|
+
With this it is possible to interpret string as if they were integers.
|
|
14
|
+
|
|
15
|
+
This can be very handy for solving puzzles, but also for other purposes.
|
|
16
|
+
|
|
17
|
+
And it is a nice demonstration of extending a class (str) with extra and changed functionality.
|
|
15
18
|
|
|
16
19
|
# Installation
|
|
17
|
-
Installing
|
|
20
|
+
Installing istr with pip is easy.
|
|
18
21
|
```
|
|
19
|
-
$ pip install
|
|
22
|
+
$ pip install istr-python
|
|
20
23
|
```
|
|
21
24
|
or when you want to upgrade,
|
|
22
25
|
```
|
|
23
|
-
$ pip install
|
|
26
|
+
$ pip install istr-python --upgrade
|
|
24
27
|
```
|
|
25
|
-
|
|
26
|
-
Alternatively, istrlib.py can be just copied into you current work directory from GitHub (https://github.com/salabim/istrlib).
|
|
28
|
+
Alternatively, istr.py can be just copied into you current work directory from GitHub (https://github.com/salabim/istr).
|
|
27
29
|
|
|
28
30
|
No dependencies!
|
|
29
31
|
|
|
@@ -31,7 +33,7 @@ No dependencies!
|
|
|
31
33
|
Just start with
|
|
32
34
|
|
|
33
35
|
```
|
|
34
|
-
from
|
|
36
|
+
from istr import istr
|
|
35
37
|
```
|
|
36
38
|
|
|
37
39
|
Now we can define some istrs:
|
|
@@ -43,19 +45,19 @@ Them we can do
|
|
|
43
45
|
```
|
|
44
46
|
x= four * five
|
|
45
47
|
```
|
|
46
|
-
, after which x is `istr("
|
|
48
|
+
, after which x is `istr("20")`
|
|
47
49
|
|
|
48
50
|
And now we can do
|
|
49
51
|
```
|
|
50
|
-
print(x ==
|
|
51
|
-
print(x == "
|
|
52
|
+
print(x == 20)
|
|
53
|
+
print(x == "20")
|
|
52
54
|
```
|
|
53
55
|
resulting in two times `True`. That's because istr instances are treated as int, although they are strings.
|
|
54
56
|
|
|
55
57
|
That means that we can also say
|
|
56
58
|
```
|
|
57
|
-
print(x <
|
|
58
|
-
print(x >= "
|
|
59
|
+
print(x < 30)
|
|
60
|
+
print(x >= "10")
|
|
59
61
|
```
|
|
60
62
|
again resulting in two times `True`.
|
|
61
63
|
|
|
@@ -103,7 +105,7 @@ Note that all calculations are strictly integer calculations. That means that if
|
|
|
103
105
|
Also divisions are always floor divisions!
|
|
104
106
|
|
|
105
107
|
There's a special case for `istr("")`. This is a proper empty string, but also represents the value of 0.
|
|
106
|
-
That is to allow for istr("").join(i for i in "01234"
|
|
108
|
+
That is to allow for istr("").join(i for i in "01234)"
|
|
107
109
|
|
|
108
110
|
Sorting a list of istrs is based on the integer value, not the string. So
|
|
109
111
|
|
|
@@ -121,3 +123,5 @@ is
|
|
|
121
123
|
|
|
122
124
|
`'0 1 2 3 4 5 6 7 8 9 10 11'`
|
|
123
125
|
|
|
126
|
+
# Additional methods
|
|
127
|
+
It is possible to test for even/odd
|
|
@@ -3,8 +3,9 @@ pyproject.toml
|
|
|
3
3
|
istr/__init__.py
|
|
4
4
|
istr/install istr.py
|
|
5
5
|
istr/istr.py
|
|
6
|
+
istr/sendmoremoney.py
|
|
6
7
|
istr_python.egg-info/PKG-INFO
|
|
7
8
|
istr_python.egg-info/SOURCES.txt
|
|
8
9
|
istr_python.egg-info/dependency_links.txt
|
|
9
10
|
istr_python.egg-info/top_level.txt
|
|
10
|
-
|
|
11
|
+
tests/test_istr.py
|
|
@@ -7,8 +7,9 @@ name = "istr-python"
|
|
|
7
7
|
authors = [
|
|
8
8
|
{name = "Ruud van der Ham", email = "rt.van.der.ham@gmail.com"}
|
|
9
9
|
]
|
|
10
|
-
description = "istr
|
|
11
|
-
|
|
10
|
+
description = "istr is a module to use strings as if they were integers."
|
|
11
|
+
|
|
12
|
+
version = "0.0.2"
|
|
12
13
|
readme = "README.md"
|
|
13
14
|
requires-python = ">=3.7"
|
|
14
15
|
dependencies = [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|