A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-January/147116.html below:

[Python-Dev] Adding bytes.frombuffer() constructor to PEP 467

[Python-Dev] Adding bytes.frombuffer() constructor to PEP 467INADA Naoki songofacandy at gmail.com
Fri Jan 6 05:38:04 EST 2017
>
> Thinking more about this, and after looking at my own code in asyncpg and
> uvloop, I'm now in favor of adding bytes.frombuffer() with the proposed
> signature: ``bytes.frombuffer(byteslike, length=-1, offset=0)``
>

Do you prefer a signature proposed first?
I thought it from asyncio usage too.  Slicing from head of bytearray
is more common
than offset usage.

But in previous thread, Serhiy and Victor proposed signature same to
old buffer API.

> I like the idea with Serhiy's API (as Python 2 buffer constructor):
>
> bytes.frombuf(buffer, [offset, size])
> bytearray.frombuf(buffer, [offset, size])
> memoryview.frombuf(buffer, [offset, size])
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4