Skip to content

Indexing via a list #274

Open
Open
@scott-griffiths

Description

@scott-griffiths

A new feature looks to be going into bitarray, which we could either expose directly or utilise for a performance increase in some methods: ilanschnell/bitarray#204

>>> a = BitArray('0x0000')
>>> a[[0, 2, 7]] = 1
>>> a[[0, 2, 7]]
BitArray('0b111')
>>> del a[[0, 2, 7]]

Certainly this should be used in the implementation of set. I think a[iterable] = value is equivalent to a.set(value, iterable so that's not extra functionality. But x = a[iterable] is new - does this suggest we're missing a a.get(iterable) -> BitArray for symmetry? Is del a[iterable] actually a useful thing to be able to do? Maybe.

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions