Skip to content

Commit 219021a

Browse files
committed
add release date - update docs
1 parent 80f9d88 commit 219021a

4 files changed

Lines changed: 26 additions & 6 deletions

File tree

CHANGE_LOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2025-XX-XX 3.5.0:
1+
2025-07-06 3.5.0:
22
-------------------
33
* add `util.random_p()`
44
* improve sparse compression testing

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,9 @@ This sub-module was added in version 1.2.
901901
The bitarrays are reproducible when calling Python's ``random.seed()`` with a
902902
specific seed value.
903903

904-
This function is only implemented when using Python 3.12 or higher, as it
905-
requires the standard library function ``random.binomialvariate()``.
904+
This function requires Python 3.12 or higher, as it depends on the standard
905+
library function ``random.binomialvariate()``. Raises ``NotImplementedError``
906+
when Python version is too low.
906907

907908
New in version 3.5
908909

doc/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Change log
22
==========
33

4+
**3.5.0** (2025-07-06):
5+
6+
* add ``util.random_p()``
7+
* improve sparse compression testing
8+
9+
410
**3.4.3** (2025-06-23):
511

612
* minor updates to documentation

doc/reference.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Reference
22
=========
33

4-
bitarray version: 3.4.3 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__
4+
bitarray version: 3.5.0 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__
55

66
In the following, ``item`` and ``value`` are usually a single bit -
77
an integer 0 or 1.
@@ -502,6 +502,19 @@ This sub-module was added in version 1.2.
502502
New in version 1.8
503503

504504

505+
``random_p(n, /, p=0.5, endian=None)`` -> bitarray
506+
Return pseudo-random bitarray of length ``n``. Each bit has probability ``p`` of
507+
being 1. Equivalent to ``bitarray((random() < p for _ in range(n)), endian)``.
508+
The bitarrays are reproducible when calling Python's ``random.seed()`` with a
509+
specific seed value.
510+
511+
This function requires Python 3.12 or higher, as it depends on the standard
512+
library function ``random.binomialvariate()``. Raises ``NotImplementedError``
513+
when Python version is too low.
514+
515+
New in version 3.5
516+
517+
505518
``sc_decode(stream)`` -> bitarray
506519
Decompress binary stream (an integer iterator, or bytes-like object) of a
507520
sparse compressed (``sc``) bitarray, and return the decoded bitarray.
@@ -545,8 +558,8 @@ This sub-module was added in version 1.2.
545558
iteration is stopped as soon as one mismatch is found.
546559

547560

548-
``urandom(length, /, endian=None)`` -> bitarray
549-
Return a bitarray of ``length`` random bits (uses ``os.urandom``).
561+
``urandom(n, /, endian=None)`` -> bitarray
562+
Return random bitarray of length ``n`` (uses ``os.urandom()``).
550563

551564
New in version 1.7
552565

0 commit comments

Comments
 (0)