Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle extending self correctly #28

Merged
merged 1 commit into from
May 29, 2018
Merged

Handle extending self correctly #28

merged 1 commit into from
May 29, 2018

Conversation

DRMacIver
Copy link
Contributor

Pythons list implementation has a special case to ensure that
x.extend(x) is the same as x.extend(list(x)). i.e. it doesn't notice
changes to the size of the list during the extend.

Previously this case would not have been handled correctly by
bitarray. This changes that by checking what the size of the other
array is before we make any changes. This ensures both that this works
correctly and also (importantly) that we don't try to write past the
end of the array.

Pythons list implementation has a special case to ensure that
x.extend(x) is the same as x.extend(list(x)). i.e. it doesn't notice
changes to the size of the list during the extend.

Previously this case would not have been handled correctly by
bitarray. This changes that by checking what the size of the other
array is before we make any changes. This ensures both that this works
correctly and also (importantly) that we don't try to write past the
end of the array.
@andre-merzky
Copy link

Hey @DRMacIver,

this repo has been silent for quite a while, and we thus created a fork at https://github.com/diamondman/bitarray/.

If you are interested, please feel free to transplant your pull request to the forked repo, we would be very happy to begin the code review and merge into bitarray before pushing out a new release. If you do not have the time to do so, we would kindly ask your permission to do the PR transfer our-self. If you could ping back in the next couple of days, one way or the other, that would be great.

Many thanks!

@ilanschnell
Copy link
Owner

Thanks for the PR! (And sorry for merging it almost 3 years later)

@ilanschnell ilanschnell merged commit 7d2b4c8 into ilanschnell:master May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants