Before the horse is totally dead... (maybe it already is), a couple
> In such cases, an extension module written in something like Cython, C
> or Rust would be a better fit,
well, yes, but:
> From that perspective, adding "[bytes/bytearray].frombuffer"
this would be used for the fairly simple use case of passing stuff around
between different modules, which would probably be written in something
lower lever -- unless they too, only passed data around. Passign data
around is a pretty good use-case for Python.
> complexity to the core language for the sake of giving people one
> small additional piece of incremental performance improvement
here's the thing: this is a very small increase in complexity in exchange
for a small increase in performance -- really not a big deal either way. If
either of those were large, hte decision would be a no brainer.
By contrast, a library that provided better low level data buffer
> manipulation that was suitable for asyncio's needs is *much* easier to
> emulate on older versions, and provides more scope for extracting
> efficient data manipulation patterns beyond this one very specific
> case of more efficiently snapshotting a subset of an existing buffer.
IS this na either-or? IF someone is proposing a nice lib for "low level
manipulation", then yes, putting frombuffer() in there would be a fine idea.
But if there is no such proposal on the table, then I think adding a
frombuffer method to the bytes object is a small improvement that we can do
pretty cool -- I guess I should take a look at Rust...
Christopher Barker, Ph.D.
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Python-Dev mailing list