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

Accept mmap objects in places where bytearray is expected. #3014

Closed
wants to merge 2 commits into from

Conversation

jonathanslenders
Copy link
Contributor

Fixes #1467.

@srittau
Copy link
Collaborator

srittau commented May 27, 2019

I assume that mmap actually implements the buffer protocol, but I didn't check. We should preferably fix python/typing#593.

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, even if typing.Buffer is a better solution

@JelleZijlstra
Copy link
Member

mypy is unhappy with this because of various incompatible method overrides. I suppose we either have to # type: ignore most of the class or implement typing.Buffer.

@srittau
Copy link
Collaborator

srittau commented Oct 8, 2019

I am going to close this for now. Please reopen, if you want to try fixing the build errors.

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.

Mypy does not accept mmap object in re.match
3 participants