A RetroSearch Logo

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

Search Query:

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

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

[Python-Dev] Adding bytes.frombuffer() constructor to PEP 467 [Python-Dev] Adding bytes.frombuffer() constructor to PEP 467INADA Naoki songofacandy at gmail.com
Thu Jan 5 19:11:54 EST 2017
>
> bytes.frombuffer(x) is bytes(memoryview(x)) or memoryview(x).tobytes().
>

There is pitfall: memoryview should be closed.
So b = bytes.frombuffer(x) is:

with memoryview(x) as m:
    b = bytes(m)
    # or b = m.tobytes()
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