bitarray 3.9.0__tar.gz → 3.9.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bitarray
3
- Version: 3.9.0
3
+ Version: 3.9.2
4
4
  Summary: efficient arrays of booleans -- C extension
5
5
  Home-page: https://github.com/ilanschnell/bitarray
6
6
  Author: Ilan Schnell
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3.13
21
21
  Classifier: Programming Language :: Python :: 3.14
22
- Classifier: Programming Language :: Python :: Free Threading :: 1 - Unstable
22
+ Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta
23
23
  Classifier: Topic :: Utilities
24
24
  Requires-Python: >=3.7
25
25
  License-File: LICENSE
@@ -92,9 +92,11 @@ Once you have installed the package, you may want to test it:
92
92
 
93
93
  $ python -c 'import bitarray; bitarray.test()'
94
94
  bitarray is installed in: /Users/ilan/bitarray/bitarray
95
- bitarray version: 3.9.0
95
+ bitarray version: 3.9.2
96
96
  sys.version: 3.14.5 (main, May 20 2026) [Clang 20.1.8]
97
97
  sys.prefix: /Users/ilan/miniforge
98
+ sys.abiflags: ''
99
+ sys._is_gil_enabled(): True
98
100
  pointer size: 64 bit
99
101
  sizeof(size_t): 8
100
102
  sizeof(bitarrayobject): 80
@@ -108,7 +110,7 @@ Once you have installed the package, you may want to test it:
108
110
  ................................................s........................
109
111
  ......s.........................................................
110
112
  ----------------------------------------------------------------------
111
- Ran 622 tests in 0.191s
113
+ Ran 633 tests in 0.191s
112
114
 
113
115
  OK (skipped=2)
114
116
 
@@ -355,7 +357,7 @@ and can therefore be used as a dictionary key:
355
357
  Reference
356
358
  =========
357
359
 
358
- bitarray version: 3.9.0 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__
360
+ bitarray version: 3.9.2 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__
359
361
 
360
362
  In the following, ``item`` and ``value`` are usually a single bit -
361
363
  an integer 0 or 1.
@@ -424,13 +426,16 @@ bitarray methods:
424
426
 
425
427
  ``bytereverse(start=0, stop=<end of buffer>, /)``
426
428
  For each byte in byte-range(``start``, ``stop``) reverse bits in-place.
427
- The start and stop indices are given in terms of bytes (not bits).
429
+ The start and stop indices are given in terms of bytes (not bits) and
430
+ are interpreted like slice bounds and clipped to the buffer size.
428
431
  Also note that this method only changes the buffer; it does not change the
429
432
  bit-endianness of the bitarray object. Pad bits are left unchanged such
430
433
  that two consecutive calls will always leave the bitarray unchanged.
431
434
 
432
435
  New in version 2.2.5: optional start and stop arguments
433
436
 
437
+ New in version 3.9.1: clip arguments instead of raising ``IndexError``
438
+
434
439
 
435
440
  ``clear()``
436
441
  Remove all items from bitarray.
@@ -564,7 +569,7 @@ bitarray methods:
564
569
  Rotate bitarray in-place by ``k`` positions.
565
570
  Positive ``k`` rotates right, negative ``k`` rotates left.
566
571
 
567
- When bitarray is not empty, rotating one step to the right is
572
+ When bitarray ``a`` is not empty, rotating one step to the right is
568
573
  equivalent to ``a.insert(0, a.pop())``, and rotating one step to the left
569
574
  is equivalent to ``a.append(a.pop(0))``.
570
575
  The same convention is used by the ``.rotate()`` method of
@@ -580,6 +585,9 @@ bitarray methods:
580
585
  unless ``right=True``, which will iterate in descending order (starting with
581
586
  rightmost match).
582
587
 
588
+ For example, ``a.search(1)`` is the easiest (and most efficient) way
589
+ to create an iterator over all active indices in ``a``.
590
+
583
591
  See also: `Bitarray 3 transition <https://github.com/ilanschnell/bitarray/blob/master/doc/bitarray3.rst>`__
584
592
 
585
593
  New in version 2.9: optional start and stop arguments - add optional keyword argument ``right``
@@ -763,8 +771,8 @@ This sub-module was added in version 1.2.
763
771
 
764
772
  ``byteswap(a, n=<buffer size>, /)``
765
773
  Reverse every ``n`` consecutive bytes of ``a`` in-place.
766
- By default, all bytes are reversed. Note that ``n`` is not limited to 2, 4
767
- or 8, but can be any positive integer.
774
+ By default, all bytes are reversed. Note that ``n`` is **not** limited
775
+ to 2, 4 or 8, but can be any positive integer.
768
776
  Also, ``a`` may be any object that exposes a writable buffer.
769
777
  Nothing about this function is specific to bitarray objects.
770
778
 
@@ -947,9 +955,9 @@ This sub-module was added in version 1.2.
947
955
 
948
956
 
949
957
  ``sc_encode(bitarray, /)`` -> bytes
950
- Compress a sparse bitarray and return its binary representation.
951
- This representation is useful for efficiently storing sparse bitarrays.
952
- Use ``sc_decode()`` for decompressing (decoding).
958
+ Compress a bitarray using sparse encoding and return its binary
959
+ representation. This representation is useful for efficiently storing
960
+ sparse bitarrays. Use ``sc_decode()`` for decompressing (decoding).
953
961
 
954
962
  See also: `Compression of sparse bitarrays <https://github.com/ilanschnell/bitarray/blob/master/doc/sparse_compression.rst>`__
955
963
 
@@ -57,9 +57,11 @@ Once you have installed the package, you may want to test it:
57
57
 
58
58
  $ python -c 'import bitarray; bitarray.test()'
59
59
  bitarray is installed in: /Users/ilan/bitarray/bitarray
60
- bitarray version: 3.9.0
60
+ bitarray version: 3.9.2
61
61
  sys.version: 3.14.5 (main, May 20 2026) [Clang 20.1.8]
62
62
  sys.prefix: /Users/ilan/miniforge
63
+ sys.abiflags: ''
64
+ sys._is_gil_enabled(): True
63
65
  pointer size: 64 bit
64
66
  sizeof(size_t): 8
65
67
  sizeof(bitarrayobject): 80
@@ -73,7 +75,7 @@ Once you have installed the package, you may want to test it:
73
75
  ................................................s........................
74
76
  ......s.........................................................
75
77
  ----------------------------------------------------------------------
76
- Ran 622 tests in 0.191s
78
+ Ran 633 tests in 0.191s
77
79
 
78
80
  OK (skipped=2)
79
81
 
@@ -320,7 +322,7 @@ and can therefore be used as a dictionary key:
320
322
  Reference
321
323
  =========
322
324
 
323
- bitarray version: 3.9.0 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__
325
+ bitarray version: 3.9.2 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__
324
326
 
325
327
  In the following, ``item`` and ``value`` are usually a single bit -
326
328
  an integer 0 or 1.
@@ -389,13 +391,16 @@ bitarray methods:
389
391
 
390
392
  ``bytereverse(start=0, stop=<end of buffer>, /)``
391
393
  For each byte in byte-range(``start``, ``stop``) reverse bits in-place.
392
- The start and stop indices are given in terms of bytes (not bits).
394
+ The start and stop indices are given in terms of bytes (not bits) and
395
+ are interpreted like slice bounds and clipped to the buffer size.
393
396
  Also note that this method only changes the buffer; it does not change the
394
397
  bit-endianness of the bitarray object. Pad bits are left unchanged such
395
398
  that two consecutive calls will always leave the bitarray unchanged.
396
399
 
397
400
  New in version 2.2.5: optional start and stop arguments
398
401
 
402
+ New in version 3.9.1: clip arguments instead of raising ``IndexError``
403
+
399
404
 
400
405
  ``clear()``
401
406
  Remove all items from bitarray.
@@ -529,7 +534,7 @@ bitarray methods:
529
534
  Rotate bitarray in-place by ``k`` positions.
530
535
  Positive ``k`` rotates right, negative ``k`` rotates left.
531
536
 
532
- When bitarray is not empty, rotating one step to the right is
537
+ When bitarray ``a`` is not empty, rotating one step to the right is
533
538
  equivalent to ``a.insert(0, a.pop())``, and rotating one step to the left
534
539
  is equivalent to ``a.append(a.pop(0))``.
535
540
  The same convention is used by the ``.rotate()`` method of
@@ -545,6 +550,9 @@ bitarray methods:
545
550
  unless ``right=True``, which will iterate in descending order (starting with
546
551
  rightmost match).
547
552
 
553
+ For example, ``a.search(1)`` is the easiest (and most efficient) way
554
+ to create an iterator over all active indices in ``a``.
555
+
548
556
  See also: `Bitarray 3 transition <https://github.com/ilanschnell/bitarray/blob/master/doc/bitarray3.rst>`__
549
557
 
550
558
  New in version 2.9: optional start and stop arguments - add optional keyword argument ``right``
@@ -728,8 +736,8 @@ This sub-module was added in version 1.2.
728
736
 
729
737
  ``byteswap(a, n=<buffer size>, /)``
730
738
  Reverse every ``n`` consecutive bytes of ``a`` in-place.
731
- By default, all bytes are reversed. Note that ``n`` is not limited to 2, 4
732
- or 8, but can be any positive integer.
739
+ By default, all bytes are reversed. Note that ``n`` is **not** limited
740
+ to 2, 4 or 8, but can be any positive integer.
733
741
  Also, ``a`` may be any object that exposes a writable buffer.
734
742
  Nothing about this function is specific to bitarray objects.
735
743
 
@@ -912,9 +920,9 @@ This sub-module was added in version 1.2.
912
920
 
913
921
 
914
922
  ``sc_encode(bitarray, /)`` -> bytes
915
- Compress a sparse bitarray and return its binary representation.
916
- This representation is useful for efficiently storing sparse bitarrays.
917
- Use ``sc_decode()`` for decompressing (decoding).
923
+ Compress a bitarray using sparse encoding and return its binary
924
+ representation. This representation is useful for efficiently storing
925
+ sparse bitarrays. Use ``sc_decode()`` for decompressing (decoding).
918
926
 
919
927
  See also: `Compression of sparse bitarrays <https://github.com/ilanschnell/bitarray/blob/master/doc/sparse_compression.rst>`__
920
928