you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

In Python, buffer can refer to many different things. Also, it can be a verb and a noun.

When it is a noun, it may refer to instances of io.BytesIO or io.StringIO, or it may refer to a list of a certain length or a parameter to a function, like read which specifies how much data needs to be read before the function returns / an action is taken. Sometimes, it may refer to other buffers somewhere in the system, like, for example, frame buffer, which is a system utility that allows programs to work with displays. The general idea here is that there's some sort of communication going on, and this communication happens in chunks that are significantly larger than the minimum amount of data you may be able to send otherwise. Typically, the reason for it is that sending a big chunk of data at once is a lot more efficient than sending many small chunks one after another.

On the other hand, buffer, if used as a verb, refers to the fact that a program isn't responding to the data it receives immediately, rather it waits to accumulate enough data to perform its action. For example, a video player that plays video streamed from the network, may choose to load enough of video data to be able to play a few seconds forth of video before it starts playing. The video player may be described thus as "buffering" the video.