Deprecate mark
, unmark
, ismarked
, reset
#58034
Labels
io
Involving the I/O subsystem: libuv, read, write, etc.
mark
, unmark
, ismarked
, reset
#58034
This is part of a larger discussion of IO, but I'm making a separate issue so we can refer here, and to make sure this is being tracked.
I propose we deprecate these functions, and remove references to these functions from docstrings.
What are they good for? As far as I can tell, their main use is
These functions have problems currently, and I think we can achieve what they do, using better abstractions:
IO
has a property calledmark
, and that this returns a 1-based integer, with -1 as the sentinel value. This is not great..mark
field to their IO, then their code for manipulating this buffer will, by default, be wrong.We can achieve the same thing using my proposed buffered IO interface in #57982. This API gives users access to the IOs internal buffer. If a user then decides they want to hold only bytes from position
p
, they can simply callconsume(io, p-1)
, then callfillbuffer(io)
until they get the bytes they want, and operate on those.But maybe I'm missing something about why these functions exist.
See also: #40500
The text was updated successfully, but these errors were encountered: