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

Fix writeframes type in wave #6997

Merged
merged 2 commits into from
Jan 22, 2022
Merged

Fix writeframes type in wave #6997

merged 2 commits into from
Jan 22, 2022

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Jan 22, 2022

Here's the source code for it:

    def writeframesraw(self, data):
        if not isinstance(data, (bytes, bytearray)):
            data = memoryview(data).cast('B')

https://github.com/python/cpython/blob/ce7d66771ec64488134a1dd114015aa056eef696/Lib/wave.py#L423-L425

So, basically it accepts bytes, bytearray, and any type memoryview accepts.
Which is ReadableBuffer:

def __init__(self, obj: ReadableBuffer) -> None: ...

@sobolevn
Copy link
Member Author

@sobolevn
Copy link
Member Author

As some of us know all too well

Sorry, I didn't get this one 🙂

@AlexWaygood
Copy link
Member

AlexWaygood commented Jan 22, 2022

As some of us know all too well

Sorry, I didn't get this one 🙂

Sorry — bad attempt at a joke based on python/mypy#11887! Not my finest ;)

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@sobolevn
Copy link
Member Author

My english-language jokes are the worst!
That's why I don't even try 😆

@JelleZijlstra JelleZijlstra merged commit 7ab84cf into python:master Jan 22, 2022
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