[Python-Dev] Adding bytes.frombuffer() constructor to PEP 467
INADA Naoki
songofacandy at gmail.com
Fri Jan 6 06:17:57 EST 2017
More information about the Python-Dev mailing list
Fri Jan 6 06:17:57 EST 2017
- Previous message (by thread): [Python-Dev] Adding bytes.frombuffer() constructor to PEP 467
- Next message (by thread): [Python-Dev] Context manager lifetime rules Was: Re: Adding bytes.frombuffer() constructor to PEP 467
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I submit an issue about it. See https://bugs.python.org/issue29178 On Fri, Jan 6, 2017 at 7:38 PM, INADA Naoki <songofacandy at gmail.com> wrote: >> >> 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])
- Previous message (by thread): [Python-Dev] Adding bytes.frombuffer() constructor to PEP 467
- Next message (by thread): [Python-Dev] Context manager lifetime rules Was: Re: Adding bytes.frombuffer() constructor to PEP 467
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list