diff --git a/CHANGE_LOG b/CHANGE_LOG index eb725c60..326bd9c5 100644 --- a/CHANGE_LOG +++ b/CHANGE_LOG @@ -1,4 +1,4 @@ -20XX-XX-XX 2.9.2: +2024-01-01 2.9.2: ------------------- * optimize initialization from strings by not constantly resizing buffer * optimize `util.hex2ba()` and `util.base2ba()` by avoiding unnecessary diff --git a/LICENSE b/LICENSE index bfa6891f..f99e04db 100644 --- a/LICENSE +++ b/LICENSE @@ -11,7 +11,7 @@ license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use bitarray alone or in any derivative version, provided, however, that Ilan Schnell's License Agreement and Ilan Schnell's notice of copyright, i.e., "Copyright (c) -2008 - 2023 Ilan Schnell; All Rights Reserved" are retained in bitarray +2008 - 2024 Ilan Schnell; All Rights Reserved" are retained in bitarray alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on diff --git a/README.rst b/README.rst index b882a0b7..19f108ca 100644 --- a/README.rst +++ b/README.rst @@ -78,7 +78,7 @@ Once you have installed the package, you may want to test it: $ python -c 'import bitarray; bitarray.test()' bitarray is installed in: /Users/ilan/bitarray/bitarray - bitarray version: 2.9.1 + bitarray version: 2.9.2 sys.version: 3.11.0 (main, Oct 25 2022) [Clang 14.0.4] sys.prefix: /Users/ilan/Mini3/envs/py311 pointer size: 64 bit @@ -427,7 +427,7 @@ and can therefore be used as a dictionary key: Reference ========= -bitarray version: 2.9.1 -- `change log `__ +bitarray version: 2.9.2 -- `change log `__ In the following, ``item`` and ``value`` are usually a single bit - an integer 0 or 1. @@ -865,8 +865,6 @@ This sub-module was added in version 1.2. Return a string containing the base ``n`` ASCII representation of the bitarray. Allowed values for ``n`` are 2, 4, 8, 16, 32 and 64. The bitarray has to be multiple of length 1, 2, 3, 4, 5 or 6 respectively. - For ``n=16`` (hexadecimal), ``ba2hex()`` will be much faster, as ``ba2base()`` - does not take advantage of byte level operations. For ``n=32`` the RFC 4648 Base32 alphabet is used, and for ``n=64`` the standard base 64 alphabet is used. @@ -878,8 +876,6 @@ This sub-module was added in version 1.2. ``base2ba(n, asciistr, /, endian=None)`` -> bitarray Bitarray of base ``n`` ASCII representation. Allowed values for ``n`` are 2, 4, 8, 16, 32 and 64. - For ``n=16`` (hexadecimal), ``hex2ba()`` will be much faster, as ``base2ba()`` - does not take advantage of byte level operations. For ``n=32`` the RFC 4648 Base32 alphabet is used, and for ``n=64`` the standard base 64 alphabet is used. diff --git a/bitarray/__init__.py b/bitarray/__init__.py index 05c515d5..86982eb7 100644 --- a/bitarray/__init__.py +++ b/bitarray/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2008 - 2023, Ilan Schnell; All Rights Reserved +# Copyright (c) 2008 - 2024, Ilan Schnell; All Rights Reserved """ This package defines an object type which can efficiently represent a bitarray. Bitarrays are sequence types and behave very much like lists. diff --git a/bitarray/__init__.pyi b/bitarray/__init__.pyi index b0cca1e4..68b6dd68 100644 --- a/bitarray/__init__.pyi +++ b/bitarray/__init__.pyi @@ -1,4 +1,4 @@ -# Copyright (c) 2021 - 2023, Ilan Schnell; All Rights Reserved +# Copyright (c) 2021 - 2024, Ilan Schnell; All Rights Reserved # # This stub, as well as util.pyi, are tested with Python 3.9 and mypy 0.950 diff --git a/bitarray/_bitarray.c b/bitarray/_bitarray.c index 758abef5..55cedb11 100644 --- a/bitarray/_bitarray.c +++ b/bitarray/_bitarray.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2008 - 2023, Ilan Schnell; All Rights Reserved + Copyright (c) 2008 - 2024, Ilan Schnell; All Rights Reserved bitarray is published under the PSF license. This file is the C part of the bitarray package. diff --git a/bitarray/_util.c b/bitarray/_util.c index 2d2fa39d..8b8f5a41 100644 --- a/bitarray/_util.c +++ b/bitarray/_util.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2019 - 2023, Ilan Schnell; All Rights Reserved + Copyright (c) 2019 - 2024, Ilan Schnell; All Rights Reserved bitarray is published under the PSF license. This file contains the C implementation of some useful utility functions. diff --git a/bitarray/bitarray.h b/bitarray/bitarray.h index 0dae9762..c6f9e0bf 100644 --- a/bitarray/bitarray.h +++ b/bitarray/bitarray.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2008 - 2023, Ilan Schnell; All Rights Reserved + Copyright (c) 2008 - 2024, Ilan Schnell; All Rights Reserved bitarray is published under the PSF license. Author: Ilan Schnell diff --git a/bitarray/util.py b/bitarray/util.py index ea2c9033..f926eb56 100644 --- a/bitarray/util.py +++ b/bitarray/util.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 - 2023, Ilan Schnell; All Rights Reserved +# Copyright (c) 2019 - 2024, Ilan Schnell; All Rights Reserved # bitarray is published under the PSF license. # # Author: Ilan Schnell diff --git a/bitarray/util.pyi b/bitarray/util.pyi index 3b108047..cc5b9626 100644 --- a/bitarray/util.pyi +++ b/bitarray/util.pyi @@ -1,4 +1,4 @@ -# Copyright (c) 2021 - 2023, Ilan Schnell; All Rights Reserved +# Copyright (c) 2021 - 2024, Ilan Schnell; All Rights Reserved from collections import Counter from collections.abc import Iterable, Iterator, Sequence diff --git a/doc/changelog.rst b/doc/changelog.rst index 85e6548f..603f74ae 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -1,6 +1,14 @@ Change log ========== +**2.9.2** (2024-01-01): + +* optimize initialization from strings by not constantly resizing buffer +* optimize ``util.hex2ba()`` and ``util.base2ba()`` by avoiding unnecessary + copies +* optimize ``util.base2ba()`` and ``util.ba2base()`` for ``n=16`` (hexadecimal) + + **2.9.1** (2023-12-23): * avoid buffer being unnecessarily initialized with 0s in several diff --git a/doc/reference.rst b/doc/reference.rst index cbd924db..6e43f39e 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -1,7 +1,7 @@ Reference ========= -bitarray version: 2.9.1 -- `change log `__ +bitarray version: 2.9.2 -- `change log `__ In the following, ``item`` and ``value`` are usually a single bit - an integer 0 or 1. @@ -439,8 +439,6 @@ This sub-module was added in version 1.2. Return a string containing the base ``n`` ASCII representation of the bitarray. Allowed values for ``n`` are 2, 4, 8, 16, 32 and 64. The bitarray has to be multiple of length 1, 2, 3, 4, 5 or 6 respectively. - For ``n=16`` (hexadecimal), ``ba2hex()`` will be much faster, as ``ba2base()`` - does not take advantage of byte level operations. For ``n=32`` the RFC 4648 Base32 alphabet is used, and for ``n=64`` the standard base 64 alphabet is used. @@ -452,8 +450,6 @@ This sub-module was added in version 1.2. ``base2ba(n, asciistr, /, endian=None)`` -> bitarray Bitarray of base ``n`` ASCII representation. Allowed values for ``n`` are 2, 4, 8, 16, 32 and 64. - For ``n=16`` (hexadecimal), ``hex2ba()`` will be much faster, as ``base2ba()`` - does not take advantage of byte level operations. For ``n=32`` the RFC 4648 Base32 alphabet is used, and for ``n=64`` the standard base 64 alphabet is used.