istr-python 0.1.0__tar.gz → 0.1.1__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.1.0 → istr_python-0.1.1}/PKG-INFO +4 -4
- {istr_python-0.1.0 → istr_python-0.1.1}/README.md +1 -1
- {istr_python-0.1.0 → istr_python-0.1.1}/istr/istr.py +17 -21
- {istr_python-0.1.0 → istr_python-0.1.1}/istr_python.egg-info/PKG-INFO +4 -4
- {istr_python-0.1.0 → istr_python-0.1.1}/pyproject.toml +3 -8
- {istr_python-0.1.0 → istr_python-0.1.1}/tests/test_istr.py +10 -0
- {istr_python-0.1.0 → istr_python-0.1.1}/istr/__init__.py +0 -0
- {istr_python-0.1.0 → istr_python-0.1.1}/istr/install istr.py +0 -0
- {istr_python-0.1.0 → istr_python-0.1.1}/istr_python.egg-info/SOURCES.txt +0 -0
- {istr_python-0.1.0 → istr_python-0.1.1}/istr_python.egg-info/dependency_links.txt +0 -0
- {istr_python-0.1.0 → istr_python-0.1.1}/istr_python.egg-info/top_level.txt +0 -0
- {istr_python-0.1.0 → istr_python-0.1.1}/setup.cfg +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: istr-python
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: istr
|
|
3
|
+
Version: 0.1.1
|
|
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
|
|
7
7
|
Project-URL: Repository, https://github.com/salabim/istr
|
|
8
|
-
Classifier: Development Status ::
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
11
11
|
Requires-Python: >=3.7
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
|
|
14
|
-
<img src="https://www.salabim.org/
|
|
14
|
+
<img src="https://www.salabim.org/istr1.png" width=500>
|
|
15
15
|
|
|
16
16
|
# Introduction
|
|
17
17
|
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import functools
|
|
2
2
|
import math
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
__version__ = "0.1.
|
|
4
|
+
# _ _
|
|
5
|
+
# (_) ___ | |_ _ __
|
|
6
|
+
# | |/ __|| __|| '__|
|
|
7
|
+
# | |\__ \| |_ | |
|
|
8
|
+
# |_||___/ \__||_|
|
|
9
|
+
# strings you can count on
|
|
10
|
+
|
|
11
|
+
__version__ = "0.1.1"
|
|
12
|
+
import functools
|
|
13
|
+
import math
|
|
12
14
|
|
|
13
15
|
"""
|
|
14
16
|
changelog
|
|
@@ -256,7 +258,7 @@ class istr(str):
|
|
|
256
258
|
as_int = 0
|
|
257
259
|
else:
|
|
258
260
|
as_int = cls._to_int(value)
|
|
259
|
-
if cls._format == "" or cls._base != 10:
|
|
261
|
+
if (cls._format == "" or cls._base != 10) and not isinstance(value,istr):
|
|
260
262
|
if isinstance(value, str):
|
|
261
263
|
as_str = value
|
|
262
264
|
else:
|
|
@@ -491,19 +493,13 @@ class istr(str):
|
|
|
491
493
|
|
|
492
494
|
|
|
493
495
|
def main():
|
|
494
|
-
print(repr(istr(" 12")))
|
|
495
496
|
with istr.base(16):
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
print(repr(istr(12)))
|
|
502
|
-
with istr.base(16):
|
|
503
|
-
print(repr(istr(" 12")))
|
|
504
|
-
|
|
497
|
+
a = istr(15)
|
|
498
|
+
b = a * a
|
|
499
|
+
print(b)
|
|
500
|
+
c=istr(a)
|
|
501
|
+
print(repr(c))
|
|
505
502
|
|
|
506
503
|
|
|
507
504
|
if __name__ == "__main__":
|
|
508
|
-
main()
|
|
509
|
-
|
|
505
|
+
main()
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: istr-python
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: istr
|
|
3
|
+
Version: 0.1.1
|
|
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
|
|
7
7
|
Project-URL: Repository, https://github.com/salabim/istr
|
|
8
|
-
Classifier: Development Status ::
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
11
11
|
Requires-Python: >=3.7
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
|
|
14
|
-
<img src="https://www.salabim.org/
|
|
14
|
+
<img src="https://www.salabim.org/istr1.png" width=500>
|
|
15
15
|
|
|
16
16
|
# Introduction
|
|
17
17
|
|
|
@@ -7,19 +7,14 @@ 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
|
-
version = "0.1.
|
|
10
|
+
description = "istr - strings you can count on"
|
|
11
|
+
version = "0.1.1"
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.7"
|
|
14
14
|
dependencies = [
|
|
15
15
|
]
|
|
16
16
|
classifiers = [
|
|
17
|
-
|
|
18
|
-
# 3 - Alpha
|
|
19
|
-
# 4 - Beta
|
|
20
|
-
# 5 - Production/Stable
|
|
21
|
-
"Development Status :: 4 - Beta",
|
|
22
|
-
|
|
17
|
+
"Development Status :: 5 - Production/Stable",
|
|
23
18
|
"License :: OSI Approved :: MIT License",
|
|
24
19
|
"Programming Language :: Python :: 3 :: Only"
|
|
25
20
|
]
|
|
@@ -439,6 +439,16 @@ def test_base():
|
|
|
439
439
|
with istr.base(16):
|
|
440
440
|
istr(-1)
|
|
441
441
|
|
|
442
|
+
with istr.base(16):
|
|
443
|
+
a = istr(15)
|
|
444
|
+
with istr.base(10):
|
|
445
|
+
assert a * a == 225
|
|
446
|
+
with pytest.raises(ValueError):
|
|
447
|
+
assert a | a # FF can't be converted to base 10
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
442
452
|
|
|
443
453
|
def test_subclassing():
|
|
444
454
|
class jstr(istr):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|