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

Blob: implement the memory buffer interface #362

Merged
merged 1 commit into from
Apr 23, 2014

Conversation

carlosmn
Copy link
Member

This allows us to expose access to the blob's data without the need to
copy it into new buffer.

Should we take Blob.data and make it return a memoryview of the data instead of creating two ways o accessing it? I'm not too familiar with any differences in how you might want to use a PyBytes vs a memoryview.

This allows us to expose access to the blob's data without the need to
copy it into new buffer.
@jdavid
Copy link
Member

jdavid commented Apr 23, 2014

+1 to promote the efficient way. There is still Blob.read_raw() to get the bytes.

Only concern is memoryview is not available in Python 2.6

Let's do this for now:

  • Keep Blob.data the way it is for now, so we don't break anyone's code this round.
    Just the docstring should be updated to warn about the future change.
  • The tests won't pass with Python 2.6, so drop official support for it (and 3.1 by the way).

I am going to merge this and change the README file accordingly.

@jdavid jdavid merged commit 1c76d56 into libgit2:master Apr 23, 2014
@jdavid
Copy link
Member

jdavid commented Apr 23, 2014

Okey, the new support policy for Python 2.6 could read something like:

We won't actively break Python 2.6, and will accept fixes for it. But we
won't actively maintain it either.

(It looks like our support for Windows I would say...)

@carlosmn
Copy link
Member Author

Sounds good. We might be able to expose a method that calls PyBuffer_FromObject() for python 2.6 in case someone absolutely can't move even to 2.7.

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.

None yet

2 participants