-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Rename nb_available to bytesavailable #25634
Conversation
But why are there no |
|
How about |
How about |
|
3a4932b
to
38ebdbb
Compare
The PR now does |
I like the name. I still dislike the function, but given that it exists, this is a good name. |
I don't really like calling it "available" for the same reason I think the name "readavailable" is too confusing. These functions are defining that available means "buffered for instant, non-blocking access", but I think that seems hardly an intuitive definition. |
What the heck else would it mean? |
Bytes-transmitted (streams) or bytes-remaining (Files) |
I still think |
Fair point, @bicycle1885. I've opened #25659. |
Would be good to have Compat support for |
nb_available
is odd in that the prefixnb_
is pretty non-descriptive. Thus this PR renames the function tobytesavailable
, which I think is more descriptive. Indeed, I find the following example from the diff especially pleasant:How do you know it's EOF? There are no bytes available. 🙂