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

Allow for any bytes-like objects as input (e.g. memoryview) #11

Closed
llchan opened this issue May 3, 2017 · 4 comments
Closed

Allow for any bytes-like objects as input (e.g. memoryview) #11

llchan opened this issue May 3, 2017 · 4 comments
Assignees

Comments

@llchan
Copy link

llchan commented May 3, 2017

It would be beneficial to be able to pass in a buffer/memoryview without making a bytes copy. I think it would just involve using a different format string to the func arg parser (maybe y* if I'm reading this right?).

@vtermanis
Copy link
Member

Yes, I think you might be right about y* (s* in Python v2). I'll have a look later this week.

@vtermanis vtermanis changed the title Accept memoryview in lz4framed.compress Allow for any bytes-like objects as input (e.g. memoryview) May 3, 2017
vtermanis added a commit that referenced this issue May 3, 2017
- Use Py_buffer (via y*/s*) to access compression/decompression input
- Additional tests for memoryview
@vtermanis vtermanis self-assigned this May 3, 2017
@vtermanis
Copy link
Member

@llchan - What's on the dev-contrib branch should hopefully do what you want (for (de)compress and (de)compress_update methods). Would you mind trying it out? If it works as you expect I can make a minor release with it.

@llchan
Copy link
Author

llchan commented May 4, 2017

Looks like it's working :)

Appreciate the quick turnaround!

@vtermanis
Copy link
Member

Will be included in next release (at some point in near future).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants