bool-hybrid-array 9.11.7__py3-none-any.whl → 9.11.8__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 +3 -2
- bool_hybrid_array/compile_core.pyd +0 -0
- bool_hybrid_array/core.c +67099 -0
- bool_hybrid_array/core.py +78 -56
- {bool_hybrid_array-9.11.7.dist-info → bool_hybrid_array-9.11.8.dist-info}/METADATA +2 -1
- bool_hybrid_array-9.11.8.dist-info/RECORD +12 -0
- bool_hybrid_array-9.11.7.dist-info/RECORD +0 -10
- {bool_hybrid_array-9.11.7.dist-info → bool_hybrid_array-9.11.8.dist-info}/WHEEL +0 -0
- {bool_hybrid_array-9.11.7.dist-info → bool_hybrid_array-9.11.8.dist-info}/licenses/LICENSE +0 -0
- {bool_hybrid_array-9.11.7.dist-info → bool_hybrid_array-9.11.8.dist-info}/top_level.txt +0 -0
bool_hybrid_array/core.py
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
# cython: language_level=3, boundscheck=False, wraparound=False, initializedcheck=False
|
|
1
2
|
from __future__ import annotations
|
|
3
|
+
try:from mypy_extensions import mypyc_attr
|
|
4
|
+
except:
|
|
5
|
+
def mypyc_attr(*a,**k):
|
|
6
|
+
return lambda func:func
|
|
2
7
|
import builtins
|
|
3
8
|
from types import MappingProxyType
|
|
4
9
|
import array,bisect,numpy as np
|
|
@@ -7,24 +12,24 @@ import itertools,copy,sys,math,weakref,random,mmap,os
|
|
|
7
12
|
from functools import reduce
|
|
8
13
|
import operator,ctypes,gc,abc,types
|
|
9
14
|
from functools import lru_cache
|
|
10
|
-
from typing import
|
|
11
|
-
|
|
15
|
+
from typing import _GenericAlias
|
|
16
|
+
from typing import Callable, Union, Sequence, MutableSequence, Any, overload, Sized
|
|
17
|
+
hybrid_array_cache:list[tuple[Any]] = []
|
|
12
18
|
try:
|
|
13
19
|
msvcrt = ctypes.CDLL('msvcrt.dll')
|
|
14
20
|
memcpy = msvcrt.memcpy
|
|
15
21
|
except:
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
try:
|
|
23
|
+
libc = ctypes.CDLL('libc.so.6')
|
|
24
|
+
memcpy = libc.memcpy
|
|
25
|
+
except:
|
|
26
|
+
libc = ctypes.CDLL('libc.so')
|
|
27
|
+
memcpy = libc.memcpy
|
|
18
28
|
memcpy.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t)
|
|
19
29
|
memcpy.restype = ctypes.c_void_p
|
|
20
|
-
if 'UnionType' in types.__dict__:
|
|
21
|
-
class Union:
|
|
22
|
-
def __getitem__(self,*args):
|
|
23
|
-
return reduce(operator.or_, args)
|
|
24
|
-
Union = Union()
|
|
25
30
|
if 'GenericAlias' in types.__dict__:
|
|
26
31
|
_GenericAlias = types.GenericAlias
|
|
27
|
-
class ResurrectMeta(abc.ABCMeta,metaclass=abc.ABCMeta):
|
|
32
|
+
class ResurrectMeta(abc.ABCMeta,metaclass=abc.ABCMeta):# type: ignore
|
|
28
33
|
__module__ = 'bool_hybrid_array'
|
|
29
34
|
name = 'ResurrectMeta'
|
|
30
35
|
def __new__(cls, name, bases, namespace):
|
|
@@ -37,7 +42,7 @@ class ResurrectMeta(abc.ABCMeta,metaclass=abc.ABCMeta):
|
|
|
37
42
|
super_cls.__setattr__('name', name)
|
|
38
43
|
super_cls.__setattr__('bases', bases)
|
|
39
44
|
super_cls.__setattr__('namespace', namespace)
|
|
40
|
-
super_cls.__setattr__('original_dict', dict(obj.__dict__))
|
|
45
|
+
super_cls.__setattr__('original_dict', dict(obj.__dict__))# type: ignore[assignment]
|
|
41
46
|
try:del obj.original_dict["__abstractmethods__"]
|
|
42
47
|
except:pass
|
|
43
48
|
try:del obj.original_dict["_abc_impl"]
|
|
@@ -50,7 +55,7 @@ class ResurrectMeta(abc.ABCMeta,metaclass=abc.ABCMeta):
|
|
|
50
55
|
except:pass
|
|
51
56
|
try:del obj.original_dict['_abc_negative_cache_version']
|
|
52
57
|
except:pass
|
|
53
|
-
super_cls.__setattr__('original_dict', MappingProxyType(obj.original_dict))
|
|
58
|
+
super_cls.__setattr__('original_dict', MappingProxyType(obj.original_dict))# type: ignore[assignment]
|
|
54
59
|
return obj
|
|
55
60
|
@lru_cache
|
|
56
61
|
def __str__(cls):
|
|
@@ -62,14 +67,16 @@ class ResurrectMeta(abc.ABCMeta,metaclass=abc.ABCMeta):
|
|
|
62
67
|
return f'ResurrectMeta(cls = {cls},{name = },{bases = },{namespace = })'
|
|
63
68
|
return str(cls)
|
|
64
69
|
def __del__(cls):
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
try:
|
|
71
|
+
setattr(builtins,cls.name,cls)
|
|
72
|
+
if not sys.is_finalizing():
|
|
73
|
+
print(f'警告:禁止删除常变量:{cls}!')
|
|
74
|
+
raise TypeError(f'禁止删除常变量:{cls}')
|
|
75
|
+
except NameError:pass
|
|
69
76
|
def __hash__(cls):
|
|
70
77
|
return hash(cls.name+cls.__module__)
|
|
71
78
|
def __setattr__(cls,name,value):
|
|
72
|
-
if not hasattr(cls, 'x'):
|
|
79
|
+
if not hasattr(cls, 'x') or name.startswith('_'):
|
|
73
80
|
super().__setattr__(name,value)
|
|
74
81
|
return
|
|
75
82
|
if hasattr(cls, 'name') and cls.name == 'BHA_Bool' and repr(value) in {'T','F'} and name in {'T','F'}:
|
|
@@ -101,7 +108,7 @@ class ResurrectMeta(abc.ABCMeta,metaclass=abc.ABCMeta):
|
|
|
101
108
|
pass
|
|
102
109
|
original_dict = MappingProxyType(original_dict)
|
|
103
110
|
ResurrectMeta.__class__ = ResurrectMeta
|
|
104
|
-
class BHA_Function(metaclass=ResurrectMeta):
|
|
111
|
+
class BHA_Function(metaclass=ResurrectMeta):# type: ignore
|
|
105
112
|
def __init__(self,v):
|
|
106
113
|
self.data,self.module = v,__name__
|
|
107
114
|
def __call__(self,*a,**b):
|
|
@@ -121,14 +128,16 @@ def {name}({params}):
|
|
|
121
128
|
exec(func_code, globals(), local_namespace)
|
|
122
129
|
dynamic_func = local_namespace[name]
|
|
123
130
|
return cls(dynamic_func)
|
|
124
|
-
|
|
131
|
+
@mypyc_attr(native_class=False)
|
|
132
|
+
class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):# type: ignore
|
|
125
133
|
__module__ = 'bool_hybrid_array'
|
|
134
|
+
@mypyc_attr(native_class=False)
|
|
126
135
|
class _CompactBoolArray(Sequence,Exception):
|
|
127
136
|
def __init__(self, size: int):
|
|
128
137
|
self.size = size
|
|
129
138
|
self.n_uint8 = (size + 7) >> 3
|
|
130
|
-
self.data = np.zeros(self.n_uint8, dtype=np.uint8)
|
|
131
|
-
def __setitem__(self, index: int | slice, value):
|
|
139
|
+
self.data = np.zeros(self.n_uint8, dtype=np.uint8)# type: ignore[assignment]
|
|
140
|
+
def __setitem__(self, index: int | slice, value: Any):
|
|
132
141
|
ctypes_arr = self.data.ctypes.data_as(ctypes.POINTER(ctypes.c_ubyte))
|
|
133
142
|
if isinstance(index, slice):
|
|
134
143
|
start, stop, step = index.indices(self.size)
|
|
@@ -155,6 +164,7 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
155
164
|
ctypes_arr[uint8_pos] &= ~(1 << bit_offset) & 0xFF
|
|
156
165
|
if value:
|
|
157
166
|
ctypes_arr[uint8_pos] |= (1 << bit_offset)
|
|
167
|
+
|
|
158
168
|
def __getitem__(self, index: int | slice) -> bool | list[bool]:
|
|
159
169
|
if isinstance(index, slice):
|
|
160
170
|
start, stop, step = index.indices(self.size)
|
|
@@ -180,7 +190,7 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
180
190
|
new_instance = self.__class__(size=self.size)
|
|
181
191
|
new_instance.data = self.data.copy()
|
|
182
192
|
return new_instance
|
|
183
|
-
def __init__(self, split_index: int, size=None, is_sparse=False ,Type:Callable = None,hash_ = True) -> None:
|
|
193
|
+
def __init__(self, split_index: int, size=None, is_sparse=False ,Type:Callable = None,hash_:Any = True) -> None:
|
|
184
194
|
self.Type = Type if Type is not None else builtins.BHA_Bool
|
|
185
195
|
self.split_index = int(split_index)
|
|
186
196
|
self.size = size or 0
|
|
@@ -217,7 +227,7 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
217
227
|
return func
|
|
218
228
|
def __hash__(self):
|
|
219
229
|
return self._cached_hash
|
|
220
|
-
def accessor(self, i: int, value:
|
|
230
|
+
def accessor(self, i: int, value: Any = None) -> Any:
|
|
221
231
|
def _get_sparse_info(index: int) -> tuple[int, bool]:
|
|
222
232
|
pos = bisect.bisect_left(self.large, index)
|
|
223
233
|
exists = pos < len(self.large) and self.large[pos] == index
|
|
@@ -241,7 +251,12 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
241
251
|
if pos < len(self.large):
|
|
242
252
|
del self.large[pos]
|
|
243
253
|
return None
|
|
244
|
-
|
|
254
|
+
@overload
|
|
255
|
+
def __getitem__(self, idx: int, /) -> Any: ...
|
|
256
|
+
@overload
|
|
257
|
+
def __getitem__(self, idx: slice, /) -> list: ...
|
|
258
|
+
|
|
259
|
+
def __getitem__(self, key:int|slice = -1,/) -> Any:
|
|
245
260
|
if isinstance(key, slice):
|
|
246
261
|
start, stop, step = key.indices(self.size)
|
|
247
262
|
return BoolHybridArr((self[i] for i in range(start, stop, step)),hash_ = self.hash_)
|
|
@@ -249,7 +264,7 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
249
264
|
if 0 <= key < self.size:
|
|
250
265
|
return self.Type(self.accessor(key))
|
|
251
266
|
raise IndexError("索引超出范围")
|
|
252
|
-
def __setitem__(self, key: int | slice, value) -> None:
|
|
267
|
+
def __setitem__(self, key: int | slice, value:Any) -> None:
|
|
253
268
|
if isinstance(key, int):
|
|
254
269
|
adjusted_key = key if key >= 0 else key + self.size
|
|
255
270
|
if not (0 <= adjusted_key < self.size):
|
|
@@ -284,15 +299,23 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
284
299
|
def __repr__(self) -> str:
|
|
285
300
|
return(f"BoolHybridArray(split_index={self.split_index}, size={self.size}, "
|
|
286
301
|
+f"is_sparse={self.is_sparse}, small_len={len(self.small)}, large_len={len(self.large)})")
|
|
287
|
-
|
|
302
|
+
@overload
|
|
303
|
+
def __delitem__(self, key: int, /) -> None: ...
|
|
304
|
+
@overload
|
|
305
|
+
def __delitem__(self, key: slice, /) -> None: ...
|
|
306
|
+
|
|
307
|
+
def __delitem__(self, key: int|slice = -1,/) -> None:
|
|
288
308
|
key = key if key >= 0 else key + self.size
|
|
309
|
+
if isinstance(key, slice):
|
|
310
|
+
start, stop, step = key.indices(self.size)
|
|
311
|
+
for i in range(start,stop,step):del self[i]
|
|
289
312
|
if not (0 <= key < self.size):
|
|
290
313
|
raise IndexError(f"索引 {key} 超出范围 [0, {self.size})")
|
|
291
314
|
if key <= self.split_index:
|
|
292
315
|
if key >= len(self.small):
|
|
293
316
|
raise IndexError(f"小索引 {key} 超出small数组范围(长度{len(self.small)})")
|
|
294
|
-
self.small = np.delete(self.small, key)
|
|
295
|
-
self.small = np.append(self.small, not self.is_sparse)
|
|
317
|
+
self.small = np.delete(self.small, key)# type: ignore[assignment]
|
|
318
|
+
self.small = np.append(self.small, not self.is_sparse)# type: ignore[assignment]
|
|
296
319
|
self.split_index -= min(self.split_index, len(self.small) - 1)
|
|
297
320
|
else:
|
|
298
321
|
pos = bisect.bisect_left(self.large, key)
|
|
@@ -307,7 +330,7 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
307
330
|
def __reversed__(self):
|
|
308
331
|
if not self:return BHA_Iterator([])
|
|
309
332
|
return BHA_Iterator(map(self.__getitem__,range(-1,-1,-1)))
|
|
310
|
-
def insert(self, key: int, value:
|
|
333
|
+
def insert(self, key: int, value: Any) -> None:
|
|
311
334
|
value = bool(value)
|
|
312
335
|
key = key if key >= 0 else key + self.size
|
|
313
336
|
key = max(0, min(key, self.size))
|
|
@@ -318,7 +341,7 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
318
341
|
(0, key - len(self.small) + 1),
|
|
319
342
|
constant_values=not self.is_sparse
|
|
320
343
|
)
|
|
321
|
-
self.small = np.insert(self.small, key, value)
|
|
344
|
+
self.small = np.insert(self.small, key, value)# type: ignore[assignment]
|
|
322
345
|
self.split_index = min(self.split_index + 1, len(self.small) - 1)
|
|
323
346
|
else:
|
|
324
347
|
pos = bisect.bisect_left(self.large, key)
|
|
@@ -334,7 +357,7 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
334
357
|
return BHA_Iterator(map(self.__getitem__,range(self.size)))
|
|
335
358
|
def __next__(self):
|
|
336
359
|
return next(self.generator)
|
|
337
|
-
def __contains__(self, value) -> bool:
|
|
360
|
+
def __contains__(self, value:Any) -> bool:
|
|
338
361
|
if not isinstance(value, (bool,np.bool_,self.Type,BHA_bool)):return False
|
|
339
362
|
if not self.size:return False
|
|
340
363
|
for i in range(10):
|
|
@@ -348,9 +371,9 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
348
371
|
def __bool__(self) -> bool:
|
|
349
372
|
return bool(self.size)
|
|
350
373
|
def __any__(self):
|
|
351
|
-
return T in self
|
|
374
|
+
return builtins.T in self
|
|
352
375
|
def __all__(self):
|
|
353
|
-
return F not in self
|
|
376
|
+
return builtins.F not in self
|
|
354
377
|
def __eq__(self, other) -> bool:
|
|
355
378
|
if not isinstance(other, (BoolHybridArray, list, tuple, np.ndarray, array.array)):
|
|
356
379
|
return False
|
|
@@ -413,8 +436,6 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
413
436
|
arr += other
|
|
414
437
|
arr.optimize()
|
|
415
438
|
return arr
|
|
416
|
-
def __invert__(self) -> BoolHybridArray:
|
|
417
|
-
return BoolHybridArr(not val for val in self)
|
|
418
439
|
def __rand__(self, other) -> BoolHybridArray:
|
|
419
440
|
if type(other) == int:
|
|
420
441
|
other = bin(other)[2:]
|
|
@@ -535,7 +556,8 @@ class BoolHybridArray(MutableSequence,Exception,metaclass=ResurrectMeta):
|
|
|
535
556
|
def __reduce__(self):
|
|
536
557
|
return BoolHybridArr,(np.asarray(self),self.is_sparse,self.Type,self.hash_,),
|
|
537
558
|
dequeue = lambda self:self.pop(0)
|
|
538
|
-
|
|
559
|
+
@mypyc_attr(native_class=False)
|
|
560
|
+
class BoolHybridArr(BoolHybridArray,metaclass=ResurrectMeta):# type: ignore
|
|
539
561
|
__module__ = 'bool_hybrid_array'
|
|
540
562
|
def __new__(cls, lst: Iterable = (), is_sparse=None, Type = None, hash_ = True, split_index = None) -> BoolHybridArray:
|
|
541
563
|
a = isinstance(lst, (Iterator, Generator, map))
|
|
@@ -610,7 +632,8 @@ def FalsesArray(size, Type = None,hash_ = True):
|
|
|
610
632
|
split_index = int(split_index) if split_index < 150e+7*2 else int(145e+7*2)
|
|
611
633
|
return BoolHybridArray(split_index,size,True,Type = Type,hash_ = hash_)
|
|
612
634
|
Bool_Array = np.arange(2,dtype = np.uint8)
|
|
613
|
-
|
|
635
|
+
@mypyc_attr(native_class=False)
|
|
636
|
+
class BHA_bool(int,metaclass=ResurrectMeta):# type: ignore
|
|
614
637
|
__module__ = 'bool_hybrid_array'
|
|
615
638
|
def __new__(cls, value):
|
|
616
639
|
core_value = bool(value)
|
|
@@ -644,16 +667,14 @@ class BHA_bool(int,metaclass=ResurrectMeta):
|
|
|
644
667
|
def __len__(self):
|
|
645
668
|
raise TypeError("'BHA_bool' object has no attribute '__len__'")
|
|
646
669
|
__rand__,__ror__,__rxor__ = __and__,__or__,__xor__
|
|
647
|
-
|
|
670
|
+
@mypyc_attr(native_class=False)
|
|
671
|
+
class BHA_Bool(BHA_bool,metaclass=ResurrectMeta):# type: ignore
|
|
648
672
|
__module__ = 'bool_hybrid_array'
|
|
649
673
|
@lru_cache
|
|
650
674
|
def __new__(cls,v):
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
builtins.T,builtins.F = BHA_Bool.T,BHA_Bool.F
|
|
655
|
-
return BHA_Bool.T if v else BHA_Bool.F
|
|
656
|
-
class BHA_List(list,metaclass=ResurrectMeta):
|
|
675
|
+
return builtins.T if v else builtins.F
|
|
676
|
+
@mypyc_attr(native_class=False)
|
|
677
|
+
class BHA_List(list,metaclass=ResurrectMeta):# type: ignore
|
|
657
678
|
__module__ = 'bool_hybrid_array'
|
|
658
679
|
def __init__(self,arr):
|
|
659
680
|
def Temp(v):
|
|
@@ -717,7 +738,8 @@ class BHA_List(list,metaclass=ResurrectMeta):
|
|
|
717
738
|
def to_ascii_art(self, width=20):
|
|
718
739
|
art = '\n'.join([' '.join(['■' if j else ' ' for j in i]) for i in self])
|
|
719
740
|
return art
|
|
720
|
-
|
|
741
|
+
@mypyc_attr(native_class=False)
|
|
742
|
+
class BHA_Iterator(Iterator,metaclass=ResurrectMeta):# type: ignore
|
|
721
743
|
__module__ = 'bool_hybrid_array'
|
|
722
744
|
def __init__(self,data):
|
|
723
745
|
self.data,self.copy_data = itertools.tee(iter(data),2)
|
|
@@ -738,7 +760,8 @@ class BHA_Iterator(Iterator,metaclass=ResurrectMeta):
|
|
|
738
760
|
arr = np.fromiter(self, dtype=dtype)
|
|
739
761
|
return arr.copy() if copy else arr.view()
|
|
740
762
|
__rand__,__ror__,__rxor__ = __and__,__or__,__xor__
|
|
741
|
-
|
|
763
|
+
@mypyc_attr(native_class=False)
|
|
764
|
+
class ProtectedBuiltinsDict(dict,metaclass=ResurrectMeta):# type: ignore
|
|
742
765
|
def __init__(self, *args, protected_names = ("T", "F", "BHA_Bool", "BHA_List", "BoolHybridArray", "BoolHybridArr",
|
|
743
766
|
"TruesArray", "FalsesArray", "ProtectedBuiltinsDict", "builtins",
|
|
744
767
|
"__builtins__", "__dict__","ResurrectMeta","math",
|
|
@@ -838,7 +861,7 @@ def Ask_BHA(path):
|
|
|
838
861
|
memcpy(arr.buffer_info()[0], bit_stream, total_len),arr)[-1]
|
|
839
862
|
if(n := int(x, base=16),
|
|
840
863
|
lead_zero := len(x) - len(x.lstrip('0')),
|
|
841
|
-
total_len := lead_zero +
|
|
864
|
+
total_len := lead_zero + n.bit_length())
|
|
842
865
|
else array.array('B'))
|
|
843
866
|
temp = BHA_List(map(temp2,temp))
|
|
844
867
|
if len(temp) == 1:
|
|
@@ -854,10 +877,13 @@ class BHA_Queue:
|
|
|
854
877
|
def enqueue(self,v):
|
|
855
878
|
self.a.push(v)
|
|
856
879
|
def dequeue(self):
|
|
857
|
-
if self.b:
|
|
880
|
+
if self.b:
|
|
881
|
+
print("正常执行")
|
|
882
|
+
return self.b.pop()
|
|
858
883
|
elif self.a:
|
|
859
|
-
tmp =
|
|
884
|
+
tmp = self.a[::-1]
|
|
860
885
|
self.b.split_index,self.b.large,self.b.small,self.b.is_sparse = tmp.split_index,tmp.large,tmp.small,tmp.is_sparse
|
|
886
|
+
print(f"self.b:{self.b}")
|
|
861
887
|
self.a.clear()
|
|
862
888
|
return self.dequeue()
|
|
863
889
|
else:
|
|
@@ -886,7 +912,7 @@ def Create_BHA(path,arr):
|
|
|
886
912
|
mm[:] = temp
|
|
887
913
|
mm.flush()
|
|
888
914
|
def numba_opt():
|
|
889
|
-
import numba
|
|
915
|
+
import numba # type: ignore
|
|
890
916
|
sig = numba.types.Union([
|
|
891
917
|
numba.types.intp(
|
|
892
918
|
numba.types.Array(numba.types.uint32, 1, 'C'),
|
|
@@ -926,7 +952,7 @@ builtins.BHA_Function = BHA_Function
|
|
|
926
952
|
builtins.Ask_BHA = Ask_BHA
|
|
927
953
|
builtins.Create_BHA = Create_BHA
|
|
928
954
|
builtins.numba_opt = numba_opt
|
|
929
|
-
Tid,Fid = id(T),id(F)
|
|
955
|
+
Tid,Fid = id(builtins.T),id(builtins.F)
|
|
930
956
|
original_id = builtins.id
|
|
931
957
|
def fake_id(obj):
|
|
932
958
|
if isinstance(obj, BHA_bool):return Tid if obj else Fid
|
|
@@ -936,8 +962,4 @@ original_builtins_dict = builtins.__dict__.copy()
|
|
|
936
962
|
__builtins__ = ProtectedBuiltinsDict(original_builtins_dict)
|
|
937
963
|
builtins = __builtins__
|
|
938
964
|
sys.modules['builtins'] = builtins
|
|
939
|
-
builtins.name = 'builtins'
|
|
940
|
-
try:
|
|
941
|
-
sys.flags.optimize = 2
|
|
942
|
-
except:
|
|
943
|
-
pass
|
|
965
|
+
builtins.name = 'builtins'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bool-hybrid-array
|
|
3
|
-
Version: 9.11.
|
|
3
|
+
Version: 9.11.8
|
|
4
4
|
Summary: 一个高效的布尔数组(密集+稀疏混合存储,节省内存)
|
|
5
5
|
Home-page: https://github.com/BKsell/bool-hybrid-array
|
|
6
6
|
Author: 蔡靖杰
|
|
@@ -613,6 +613,7 @@ print(f"出队2个元素后: {q}") # 输出:BHA_Queue([T,T,F,T,F])
|
|
|
613
613
|
* **9.11.5**:新增BHA_Queue双栈实现队列
|
|
614
614
|
* **9.11.6**:修复从9.11.3版本开始cpython用户无法安装bool-hybrid-array包的问题
|
|
615
615
|
* **9.11.7**:修复TypeError: 'map' object is not reversible的错误
|
|
616
|
+
* **9.11.8**:增加了Windows系统Python3.14的C扩展优化
|
|
616
617
|
|
|
617
618
|
|
|
618
619
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
bool_hybrid_array/__init__.py,sha256=VlUqwA0SmYh5vdHKXT-180u9A3t7Le6Fg9ppgMj8ztc,1077
|
|
2
|
+
bool_hybrid_array/__main__.py,sha256=pjoWN4Noa_K44fqQPqp8H-diKSDf0Da8hdWFgvWUigQ,9083
|
|
3
|
+
bool_hybrid_array/compile_core.pyd,sha256=lriymUZtvs_ryeGM_K8gM33iCIfxRH5Zr5GPKhuNCtw,555520
|
|
4
|
+
bool_hybrid_array/core.c,sha256=b5KMuQ6Ma64wUx-oXYqkx_AR9sTcIO0VUZ6qz_2vDM0,3227011
|
|
5
|
+
bool_hybrid_array/core.py,sha256=uJsVr6GDzCMfDLfvO9LiE0MSjmHodu4yOYwouFpxxFQ,41921
|
|
6
|
+
bool_hybrid_array/秘密.md,sha256=Ii2NvXmv-Ktu04zJsGLcQZvlzT4gOatByE4B2wTK1Ks,48
|
|
7
|
+
bool_hybrid_array/int_array/__init__.py,sha256=HPBdZu5qlXaRI4n_oK6WhnG4ml8H-FP1G44igVxPJIA,6225
|
|
8
|
+
bool_hybrid_array-9.11.8.dist-info/licenses/LICENSE,sha256=Sg4rnGXkBDYkwJCWyxdWp5H60rhVAxpNvFh_l3JWZdY,1070
|
|
9
|
+
bool_hybrid_array-9.11.8.dist-info/METADATA,sha256=deIVm_eXDmWKFWZp65t3-0UB6PZfzprqDiBUmOaSI3U,25923
|
|
10
|
+
bool_hybrid_array-9.11.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
bool_hybrid_array-9.11.8.dist-info/top_level.txt,sha256=vk-TD77wuVQsN1rJ6uVWZX4sC_wya_WplRDwQKJoBZM,18
|
|
12
|
+
bool_hybrid_array-9.11.8.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
bool_hybrid_array/__init__.py,sha256=MvnpVFUFs0Dtf69ZsTguNfXP2k1PHhR2e9Hwsz6weR4,1039
|
|
2
|
-
bool_hybrid_array/__main__.py,sha256=pjoWN4Noa_K44fqQPqp8H-diKSDf0Da8hdWFgvWUigQ,9083
|
|
3
|
-
bool_hybrid_array/core.py,sha256=QlAhD8TSRIym76ZjtfYdLsaqtz3Es_dYT754RMQoUoY,40854
|
|
4
|
-
bool_hybrid_array/秘密.md,sha256=Ii2NvXmv-Ktu04zJsGLcQZvlzT4gOatByE4B2wTK1Ks,48
|
|
5
|
-
bool_hybrid_array/int_array/__init__.py,sha256=HPBdZu5qlXaRI4n_oK6WhnG4ml8H-FP1G44igVxPJIA,6225
|
|
6
|
-
bool_hybrid_array-9.11.7.dist-info/licenses/LICENSE,sha256=Sg4rnGXkBDYkwJCWyxdWp5H60rhVAxpNvFh_l3JWZdY,1070
|
|
7
|
-
bool_hybrid_array-9.11.7.dist-info/METADATA,sha256=Dsk-thuJ8y4ikh_JK2Ckht-ar5WhiwJow68-mLH_zL0,25858
|
|
8
|
-
bool_hybrid_array-9.11.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
-
bool_hybrid_array-9.11.7.dist-info/top_level.txt,sha256=vk-TD77wuVQsN1rJ6uVWZX4sC_wya_WplRDwQKJoBZM,18
|
|
10
|
-
bool_hybrid_array-9.11.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|