We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Receives bytes, but can also give to memoryview. (buffer.getbuffer() -> memoryview)
But pycharm will show a warning.
source code https://github.com/alexdelorenzo/aiopath/blob/main/aiopath/path.py#L180
# type-check for the buffer interface before truncating the file view = memoryview(data)
I don't quite understand what this means.
I originally used getvalue, but after reading this https://stackoverflow.com/questions/61319551/when-should-one-use-bytesio-getvalue-instead-of-getbuffer, it seems that getbuffer would be better.
Everything works, it's just that I don't want pycharm to have a warning, I just want to know, thanks.
async def resize(path, size: Tuple[int, int] = (200, 200)): img = Image.open(path) buffer = io.BytesIO() if img.mode == 'P': img = img.convert('RGB') img.thumbnail(size=size) img.save(buffer, format=img.format.lower()) await AsyncPath(path).write_bytes(buffer.getbuffer())
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Receives bytes, but can also give to memoryview. (buffer.getbuffer() -> memoryview)
But pycharm will show a warning.
source code https://github.com/alexdelorenzo/aiopath/blob/main/aiopath/path.py#L180
I don't quite understand what this means.
I originally used getvalue, but after reading this https://stackoverflow.com/questions/61319551/when-should-one-use-bytesio-getvalue-instead-of-getbuffer, it seems that getbuffer would be better.
Everything works, it's just that I don't want pycharm to have a warning, I just want to know, thanks.
The text was updated successfully, but these errors were encountered: