bool-hybrid-array 9.10.10__py3-none-any.whl → 9.10.21__py3-none-any.whl
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.
- bool_hybrid_array/__init__.py +7 -4
- bool_hybrid_array/__main__.py +17 -0
- bool_hybrid_array/core.py +874 -856
- bool_hybrid_array/int_array/__init__.py +97 -39
- {bool_hybrid_array-9.10.10.dist-info → bool_hybrid_array-9.10.21.dist-info}/METADATA +35 -8
- bool_hybrid_array-9.10.21.dist-info/RECORD +10 -0
- bool_hybrid_array-9.10.10.dist-info/RECORD +0 -10
- {bool_hybrid_array-9.10.10.dist-info → bool_hybrid_array-9.10.21.dist-info}/WHEEL +0 -0
- {bool_hybrid_array-9.10.10.dist-info → bool_hybrid_array-9.10.21.dist-info}/licenses/LICENSE +0 -0
- {bool_hybrid_array-9.10.10.dist-info → bool_hybrid_array-9.10.21.dist-info}/top_level.txt +0 -0
bool_hybrid_array/__init__.py
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
from types import ModuleType
|
|
2
|
+
from types import ModuleType,FunctionType
|
|
3
3
|
from . import core
|
|
4
4
|
from .core import __builtins__,builtins
|
|
5
|
-
|
|
5
|
+
from . import int_array
|
|
6
|
+
__version__ = "9.10.21"
|
|
6
7
|
public_objects = []
|
|
7
8
|
for name in dir(core):
|
|
8
9
|
if not name.startswith("_"):
|
|
9
10
|
obj = getattr(core, name)
|
|
10
11
|
if isinstance(obj, (type, ModuleType)) or callable(obj):
|
|
11
12
|
public_objects.append(name)
|
|
12
|
-
__all__ = public_objects + ["__version__","__builtins__","core","builtins","__dict__"]
|
|
13
|
+
__all__ = public_objects + ["__version__","__builtins__","core","builtins","__dict__","int_array"]
|
|
13
14
|
globals().update({
|
|
14
15
|
name: getattr(core, name)
|
|
15
16
|
for name in public_objects
|
|
16
17
|
})
|
|
17
18
|
try:
|
|
18
19
|
__dict__ = ProtectedBuiltinsDict(globals())
|
|
19
|
-
sys.modules[__name__] = ProtectedBuiltinsDict(
|
|
20
|
+
sys.modules[__name__+'.int_array'] = ProtectedBuiltinsDict(int_array.__dict__)
|
|
21
|
+
sys.modules[__name__+'.core'] = ProtectedBuiltinsDict(core.__dict__)
|
|
22
|
+
sys.modules[__name__] = ProtectedBuiltinsDict(globals())
|
|
20
23
|
sys.modules[__name__].name = 'bool_hybrid_array'
|
|
21
24
|
core.__dict__ = ProtectedBuiltinsDict(core.__dict__)
|
|
22
25
|
except:
|
bool_hybrid_array/__main__.py
CHANGED
|
@@ -264,4 +264,21 @@ try:numba_opt()
|
|
|
264
264
|
except:print("请先安装numba库!!!")
|
|
265
265
|
|
|
266
266
|
|
|
267
|
+
#int_array模块(9.10.10新增):
|
|
268
|
+
|
|
269
|
+
max_num = (1 << 256) - 1
|
|
270
|
+
min_num = -max_num
|
|
271
|
+
|
|
272
|
+
# 1. IntHybridArray:257位完美存储
|
|
273
|
+
arr_hybrid = int_array.IntHybridArray([max_num, min_num, 123456], bit_length=257)
|
|
274
|
+
print("✅ IntHybridArray存储结果:")
|
|
275
|
+
print(f"最大值:{arr_hybrid[0]}")
|
|
276
|
+
print(f"最小值:{arr_hybrid[1]}")
|
|
277
|
+
|
|
278
|
+
# 2. NumPy:用最大的int64尝试存储(必然失败)
|
|
279
|
+
try:
|
|
280
|
+
arr_np = np.array([max_num, min_num, 123456], dtype=np.int64)
|
|
281
|
+
print("\n❌ NumPy存储结果:", arr_np)
|
|
282
|
+
except OverflowError as e:
|
|
283
|
+
print(f"\n❌ NumPy存储失败:{e}")
|
|
267
284
|
|