Skip to content

Commit 6a415a4

Browse files
Reinstating previously failing test.
1 parent 2873c3a commit 6a415a4

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ Array('uint7', [45, 100, 15, 1])
106106
```
107107

108108

109-
<sub>Copyright (c) 2006 - 2025 Scott Griffiths</sub>
109+
<sub>Copyright (c) 2006 - 2026 Scott Griffiths</sub>

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ classifiers = [
3030
keywords = ["binary", "bitarray", "bitvector", "bitfield"]
3131
dependencies = [
3232
"bitarray >= 3.0.0, < 4.0",
33-
"tibs >= 0.5.5, < 0.6",
33+
"tibs >= 0.5.6, < 0.6",
3434
]
3535

3636
[project.urls]

release_notes.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
### Unreleased: version 4.4.0
55

6-
This version adds a new optional Rust based backend. This is turned off by default so
6+
This version adds a new optional Rust-based backend. This is turned off by default so
77
shouldn't affect users. The new backend uses the `tibs` library, which is
88
by the same author as `bitstring` and should allow some nice optimisations as
99
the whole stack can work together.
1010

11-
For now the Rust backend is still 10-20% slower than the C backend (which uses `bitarray`)
12-
so it's not recommended for general use yet. If you do want to try it then you'll need to
11+
For now the Rust backend is about the same speed as the C backend (which uses `bitarray`)
12+
so there are no real advantages to use it yet. If you do want to try it then you'll need to
1313
set the `BITSTRING_USE_RUST_CORE` environment variable.
1414

1515
```python
@@ -19,14 +19,15 @@ BITSTRING_USE_RUST_CORE=1 python your_script.py
1919
You can check which backend is being used using `bitstring.options.using_rust_core` which
2020
should be `False` unless you've enabled it as detailed above.
2121

22-
The plan is to remove the C backend in a future release once the Rust backend is at least as
23-
performant, which will allow lots of code simplifications and further performance improvements.
24-
25-
The only other change is explicit support for Python 3.14.
22+
The plan is to remove the C backend in version 5, which will allow lots of code
23+
simplifications and further performance improvements.
2624

2725
The `tibs` dependency is a bit experimental and difficult to test on every possible platform.
2826
If you experience any issues with installation then please file a bug report.
2927

28+
The only other change is explicit support for Python 3.14.
29+
30+
3031
### March 2025: version 4.3.1
3132

3233
* Updated bitarray dependency to allow for v3.x.

tests/test_bitstream.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -459,23 +459,22 @@ def test_set_slice(self):
459459
a[-100:-16] = '0x0'
460460
assert a == '0x0bcde'
461461

462-
# TODO: Reinstate test - fails for Rust core
463-
# def test_inserting_using_set_item(self):
464-
# a = BitStream()
465-
# a[0:0] = '0xdeadbeef'
466-
# assert a == '0xdeadbeef'
467-
# assert a.bytepos == 0
468-
# a[16:16] = '0xfeed'
469-
# assert a == '0xdeadfeedbeef'
470-
# assert a.bytepos == 0
471-
# a[0:0] = '0xa'
472-
# assert a == '0xadeadfeedbeef'
473-
# assert a.bitpos == 0
474-
# a.bytepos = 6
475-
# a[0:8] = '0xff'
476-
# assert a.bytepos == 6
477-
# a[8:0] = '0x000'
478-
# assert a.startswith('0xff000ead')
462+
def test_inserting_using_set_item(self):
463+
a = BitStream()
464+
a[0:0] = '0xdeadbeef'
465+
assert a == '0xdeadbeef'
466+
assert a.bytepos == 0
467+
a[16:16] = '0xfeed'
468+
assert a == '0xdeadfeedbeef'
469+
assert a.bytepos == 0
470+
a[0:0] = '0xa'
471+
assert a == '0xadeadfeedbeef'
472+
assert a.bitpos == 0
473+
a.bytepos = 6
474+
a[0:8] = '0xff'
475+
assert a.bytepos == 6
476+
a[8:0] = '0x000'
477+
assert a.startswith('0xff000ead')
479478

480479
def test_slice_assignment_bit_pos(self):
481480
a = BitStream('int:64=-1')

0 commit comments

Comments
 (0)