Skip to content

Document BytesIO buffer size #133521

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

Open
jxu opened this issue May 6, 2025 · 1 comment
Open

Document BytesIO buffer size #133521

jxu opened this issue May 6, 2025 · 1 comment
Labels
docs Documentation in the Doc dir topic-IO

Comments

@jxu
Copy link

jxu commented May 6, 2025

https://stackoverflow.com/questions/26827055/python-how-to-get-bytesio-allocated-memory-length

The length of the data stored in a BytesIO object can be accessed in several ways. The best way seems to be getbuffer().nbytes. But it's not documented here
https://docs.python.org/3/library/io.html#io.BytesIO

Only here, the gigantic built-in types page https://docs.python.org/3/library/stdtypes.html#memoryview.nbytes

@jxu jxu added the docs Documentation in the Doc dir label May 6, 2025
@StanFromIreland
Copy link
Contributor

It is not undocumented as you said. Splitting up the gigantic page is tracked here: #126052

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir topic-IO
Projects
Status: Todo
Development

No branches or pull requests

3 participants