Python built-in function (--memoryview)

Source: Internet
Author: User

English documents:

class memoryview(obj)

memoryviewObjects allow Python code to access the internal data of a object that supports the buffer protocol without copying.
Create A that memoryview references obj. obj must support the buffer protocol. Built-in objects that support the buffer protocol include bytes and bytearray .

Description

1. Function function returns the Memory View object, which is actually the constructor of the memory viewing object (Momory view).

2. The so-called memory viewing object, refers to the support buffer protocol data packaging, without the need to copy objects based on allowing Python code access.

3. The objects in the Python built-in object that support the buffer protocol are bytes and ByteArray.

>>> v = memoryview (b'abcefg')>>> v[1]98>>> V[-1]103>>> v[1:4]<memory at 0x7f3ddc9f4350>>>> bytes (v[1:4]) b ' BCE '

Python built-in function (--memoryview)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.