bool-hybrid-array 9.10.20__tar.gz → 9.10.21__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.
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/PKG-INFO +2 -1
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/README.md +1 -0
- bool_hybrid_array-9.10.21/bool_hybrid_array/__init__.py +27 -0
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array/core.py +14 -2
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array.egg-info/PKG-INFO +2 -1
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/setup.py +1 -1
- bool_hybrid_array-9.10.20/bool_hybrid_array/__init__.py +0 -54
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/LICENSE +0 -0
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array/__main__.py +0 -0
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array/int_array/__init__.py +0 -0
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array//347/247/230/345/257/206.md" +0 -0
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array.egg-info/SOURCES.txt +0 -0
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array.egg-info/dependency_links.txt +0 -0
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array.egg-info/requires.txt +0 -0
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array.egg-info/top_level.txt +0 -0
- {bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bool-hybrid-array
|
|
3
|
-
Version: 9.10.
|
|
3
|
+
Version: 9.10.21
|
|
4
4
|
Summary: 一个高效的布尔数组(密集+稀疏混合存储,节省内存)
|
|
5
5
|
Home-page: https://github.com/BKsell/bool-hybrid-array
|
|
6
6
|
Author: 蔡靖杰
|
|
@@ -570,6 +570,7 @@ except OverflowError as e:
|
|
|
570
570
|
* **9.10.18.post4**:尝试修复“满屏错误”的问题×3
|
|
571
571
|
* **9.10.19**:和9.10.18.post4相同,正式版本发布
|
|
572
572
|
* **9.10.20**:优化性能,增加BHA_jit_log日志
|
|
573
|
+
* **9.10.21**:优化Ask_BHA,移除BHA_jit_log日志
|
|
573
574
|
|
|
574
575
|
|
|
575
576
|
## **彩蛋:**
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from types import ModuleType,FunctionType
|
|
3
|
+
from . import core
|
|
4
|
+
from .core import __builtins__,builtins
|
|
5
|
+
from . import int_array
|
|
6
|
+
__version__ = "9.10.21"
|
|
7
|
+
public_objects = []
|
|
8
|
+
for name in dir(core):
|
|
9
|
+
if not name.startswith("_"):
|
|
10
|
+
obj = getattr(core, name)
|
|
11
|
+
if isinstance(obj, (type, ModuleType)) or callable(obj):
|
|
12
|
+
public_objects.append(name)
|
|
13
|
+
__all__ = public_objects + ["__version__","__builtins__","core","builtins","__dict__","int_array"]
|
|
14
|
+
globals().update({
|
|
15
|
+
name: getattr(core, name)
|
|
16
|
+
for name in public_objects
|
|
17
|
+
})
|
|
18
|
+
try:
|
|
19
|
+
__dict__ = ProtectedBuiltinsDict(globals())
|
|
20
|
+
sys.modules[__name__+'.int_array'] = ProtectedBuiltinsDict(int_array.__dict__)
|
|
21
|
+
sys.modules[__name__+'.core'] = ProtectedBuiltinsDict(core.__dict__)
|
|
22
|
+
sys.modules[__name__] = ProtectedBuiltinsDict(globals())
|
|
23
|
+
sys.modules[__name__].name = 'bool_hybrid_array'
|
|
24
|
+
core.__dict__ = ProtectedBuiltinsDict(core.__dict__)
|
|
25
|
+
except:
|
|
26
|
+
pass
|
|
27
|
+
|
|
@@ -333,7 +333,7 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
333
333
|
return False
|
|
334
334
|
return all(a == b for a, b in zip(self, other))
|
|
335
335
|
def __ne__(self, other) -> bool:
|
|
336
|
-
return not self
|
|
336
|
+
return not self == other
|
|
337
337
|
def __and__(self, other) -> BoolHybridArray:
|
|
338
338
|
if type(other) == int:
|
|
339
339
|
other = abs(other)
|
|
@@ -785,7 +785,19 @@ def Ask_BHA(path):
|
|
|
785
785
|
with mm:
|
|
786
786
|
temp = mm.read().decode('utf-8').strip()
|
|
787
787
|
temp = temp.split()
|
|
788
|
-
temp2 = lambda x:BoolHybridArr(
|
|
788
|
+
temp2 = lambda x: BoolHybridArr(
|
|
789
|
+
reduce(
|
|
790
|
+
lambda acc, k: acc.append(0 if k < lead_zero else
|
|
791
|
+
(n >> ((total_len - 1) - k)) & 1
|
|
792
|
+
) or acc,
|
|
793
|
+
range(total_len),
|
|
794
|
+
array.array('B',[])),
|
|
795
|
+
hash_=F
|
|
796
|
+
)if(
|
|
797
|
+
n := int(x, base=16),
|
|
798
|
+
lead_zero := len(x) - len(x.lstrip('0')),
|
|
799
|
+
total_len := lead_zero + (n.bit_length() if n != 0 else 1)
|
|
800
|
+
)else None
|
|
789
801
|
temp = BHA_List(map(temp2,temp))
|
|
790
802
|
if len(temp) == 1:
|
|
791
803
|
return temp[0]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bool-hybrid-array
|
|
3
|
-
Version: 9.10.
|
|
3
|
+
Version: 9.10.21
|
|
4
4
|
Summary: 一个高效的布尔数组(密集+稀疏混合存储,节省内存)
|
|
5
5
|
Home-page: https://github.com/BKsell/bool-hybrid-array
|
|
6
6
|
Author: 蔡靖杰
|
|
@@ -570,6 +570,7 @@ except OverflowError as e:
|
|
|
570
570
|
* **9.10.18.post4**:尝试修复“满屏错误”的问题×3
|
|
571
571
|
* **9.10.19**:和9.10.18.post4相同,正式版本发布
|
|
572
572
|
* **9.10.20**:优化性能,增加BHA_jit_log日志
|
|
573
|
+
* **9.10.21**:优化Ask_BHA,移除BHA_jit_log日志
|
|
573
574
|
|
|
574
575
|
|
|
575
576
|
## **彩蛋:**
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
from types import ModuleType,FunctionType
|
|
3
|
-
from . import core
|
|
4
|
-
from .core import __builtins__,builtins
|
|
5
|
-
from . import int_array
|
|
6
|
-
__version__ = "9.10.20"
|
|
7
|
-
public_objects = []
|
|
8
|
-
BHA_jit_log = {}
|
|
9
|
-
def jit_class_methods(cls):
|
|
10
|
-
for attr_name in dir(cls):
|
|
11
|
-
if not attr_name.startswith("_"):
|
|
12
|
-
attr = getattr(cls, attr_name)
|
|
13
|
-
if isinstance(attr, FunctionType):
|
|
14
|
-
try:
|
|
15
|
-
setattr(cls, attr_name, jit(attr))
|
|
16
|
-
except Exception as e:
|
|
17
|
-
BHA_jit_log[attr_name] = e
|
|
18
|
-
elif isinstance(attr, classmethod):
|
|
19
|
-
original_func = attr.__func__
|
|
20
|
-
try:
|
|
21
|
-
setattr(cls, attr_name, classmethod(jit(original_func)))
|
|
22
|
-
except Exception as e:
|
|
23
|
-
BHA_jit_log[attr_name] = e
|
|
24
|
-
return cls
|
|
25
|
-
for name in dir(core):
|
|
26
|
-
if not name.startswith("_"):
|
|
27
|
-
obj = getattr(core, name)
|
|
28
|
-
if isinstance(obj, (type, ModuleType)) or callable(obj):
|
|
29
|
-
public_objects.append(name)
|
|
30
|
-
if isinstance(obj,FunctionType):
|
|
31
|
-
try:setattr(core,name,jit(obj))
|
|
32
|
-
except Exception as e:
|
|
33
|
-
BHA_jit_log[name] = e
|
|
34
|
-
elif isinstance(obj,type):
|
|
35
|
-
jit_class_methods(obj)
|
|
36
|
-
try:
|
|
37
|
-
bisect.bisect_left = jit(bisect.bisect_left)
|
|
38
|
-
bisect.bisect_right = jit(bisect.bisect_right)
|
|
39
|
-
except Exception as e:
|
|
40
|
-
BHA_jit_log["bisect"] = e
|
|
41
|
-
__all__ = public_objects + ["__version__","__builtins__","core","builtins","__dict__","int_array"]
|
|
42
|
-
globals().update({
|
|
43
|
-
name: getattr(core, name)
|
|
44
|
-
for name in public_objects
|
|
45
|
-
})
|
|
46
|
-
try:
|
|
47
|
-
__dict__ = ProtectedBuiltinsDict(globals())
|
|
48
|
-
sys.modules[__name__+'.int_array'] = ProtectedBuiltinsDict(int_array.__dict__)
|
|
49
|
-
sys.modules[__name__] = ProtectedBuiltinsDict(globals().copy())
|
|
50
|
-
sys.modules[__name__].name = 'bool_hybrid_array'
|
|
51
|
-
core.__dict__ = ProtectedBuiltinsDict(core.__dict__)
|
|
52
|
-
except:
|
|
53
|
-
pass
|
|
54
|
-
|
|
File without changes
|
|
File without changes
|
{bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array/int_array/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array.egg-info/requires.txt
RENAMED
|
File without changes
|
{bool_hybrid_array-9.10.20 → bool_hybrid_array-9.10.21}/bool_hybrid_array.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|